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()
- Creates a Treemap of ascending Alphabetical order
- Initializes StringBuffer, a Set, and an Iterator.
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& "
Append "apiSecret="+secretKey to the end
- 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?