1

I'm trying to parse this Java library into Javascript and I'm having a bit of trouble trying to understand it but my understanding of it is as follows.

Focusing on the MD5 aspects of createSign()

  1. Creates a Treemap of ascending Alphabetical order
  2. Initializes StringBuffer, a Set, and an Iterator.
  3. for Each entry in the map it gets the key value and the object value and concatenates in a fashion similar to: " api=123&signType=MD5& "

  4. Append "apiSecret="+secretKey to the end

  5. getMDString() which just converts it to a string again a function I dont believe is necessary for JS

What I am having a hard time understanding is why when I place my elements in the order indicated in step 3, and append "apiSecret="+secretKey in step four I'm still getting invalid sign?

0 Answers0