Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp.hmacSha512

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

Summary

Calculates the Hash-based Message Authentication Code (HMAC) using the SHA512 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.hmacSha512("foo", "bar");
  => "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076\
      bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce"
 

Example

  xdmp.hmacSha512("foo", "bar", "base64");
  => "EUaCkUxdAX3+Wf3IBBGLVqOmUqC4hwdZz555LtdCawgZcHa/fQFkCxsGhN955LZ\
      +N0hWaejOmNurYERfDblPzg=="
 

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.