Loading TOC...

xdmp:hmac-sha512

xdmp:hmac-sha512(
   $secretkey as item(),
   $message as item(),
   [$encoding as xs:string]
) as xs: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:hmac-sha512("foo", "bar")
  => "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076\
      bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce"
 

Example

  xdmp:hmac-sha512("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.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.