Loading TOC...

xdmp:md5

xdmp:md5(
   $data as item(),
   [$encoding as xs:string]
) as xs:string

Summary

Calculates the md5 hash of the given argument.

Parameters
$data Data to be hashed. 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:md5("foo")
  => "acbd18db4cc2f85cedef654fccc4a4d8"
 

Example

  xdmp:md5("foo", "base64")
  => "rL0Y20zC+Fzt72VPzMSk2A=="
 

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.
  • Is there any API which reverse the output of xdmp:md5? I mean how to get back the original string back?
    • The point of a hash function is that it's hard to reverse, so there is no API function to do so. You can use a hash to verify that someone knows a secret without actually storing the secret itself.