Updated on 2025-10-16 GMT+08:00

Step 3: Calculate the Signature

Use the AppSecret and to-be-signed string as the input of the encryption hash function, and convert the calculated binary signature into a hexadecimal expression.

The pseudocode is as follows:

signature = HexEncode(HMAC(AppSecret, StringToSign))

Description:

  • AppSecret: signature secret.
  • StringToSign: to-be-signed string in step 2, encoded in UTF-8.
  • HMAC (String, String): signature algorithm.
  • HexEncode(String): Base16 encoding function for returning a digest consisting of lowercase letters. Each byte you enter is expressed as two hexadecimal characters.