1. Sort all request parameters with parameter key in alphabetical order (including Common parameterss and method specific parameters, but NOT include sign and byte type parameter.
For example:
foo=1, bar=2, foo_bar=3, foobar=4
Result: bar=2, foo=1, foo_bar=3, foobar=4
2. Remove all equal sign and comma:
bar2foo1foo_bar3foobar4
3. Then concatenate appSecrect to the before and end of the result string and get the md5 value. E.g:
md5(<appSecrect>+bar2foo1foo_bar3foobar4+<appSecrect>), the real string should like: md5(h9lri085eachcz4sn7gwnkh6j0jt0yz4bar2foo1foo_bar3foobar4h9lri085eachcz4sn7gwnkh6j0jt0yz4)
Note that the string should be in UTF-8 encoding.
Note that the sign should be upper case string.
If the parameter value is a byte stream, it should be converted to hexadecimal. For example:hex(“helloworld”.getBytes(“utf-8”)) = “68656C6C6F776F726C64”
MD5 is the 128-bit summary algorithm and is in hexadecimal. a hexadecimal character can represent four bits, so the signature string length is 32 hexadecimal characters.