MarkLogic 12 EA 1 Product Documentation
xdmp.hmacSha256

xdmp.hmacSha256(
   secretkey as Item,
   message as Item,
   [encoding as String]
) as String

Summary

Calculates the Hash-based Message Authentication Code (HMAC) using the SHA256 hash function of the given secret key and message arguments.

Parameters
secretkey The secret key. Must be xs:string or a binary node.
message Message to be authenticated. Must be xs:string or a binary node.
encoding Encoding format for the output string, must be "hex" for hexadecimal or "base64". Default is "hex".

Example

  xdmp.hmacSha256("foo", "bar");
  => "f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317"
 

Example

  xdmp.hmacSha256("foo", "bar", "base64");
  => "+TILrwJJFp5zhQzWFW3tAQbiu2rYyrAbe7vr5tEGUxc="
 
Powered by MarkLogic Server | Terms of Use | Privacy Policy