
MarkLogic 9 Product Documentation
xdmp:hmac-md5xdmp:hmac-md5(
   $secretkey as item(),
   $message as item(),
   [$encoding as xs:string]
) as xs:string
Summary
  Calculates the Hash-based Message Authentication Code (HMAC) using the md5 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-md5("foo", "bar")
  => "0c7a250281315ab863549f66cd8a3a53"
 Example
  xdmp:hmac-md5("foo", "bar", "base64")
  => "DHolAoExWrhjVJ9mzYo6Uw=="
 
    Copyright © 2025 MarkLogic Corporation. MARKLOGIC is a
    registered trademark of MarkLogic Corporation.