fn:hash

Returns the results of a specified hash, checksum, or cyclic redundancy check function applied to the input.

hash($value as (xs:string | xs:hexBinary | xs:base64Binary)?, $algorithm as xs:string?:="MD5", $options as map(*)?:={}) ➔ xs:hexBinary?

Arguments

 

$value

(xs:string | xs:hexBinary | xs:base64Binary)?

The input value

 

$algorithm

xs:string?

:= "MD5"

The algorithm to use, specified by a recognised code string

 

$options

map(*)?

:= {}

Options map

Result

xs:hexBinary?

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 4.0 Functions and Operators

Saxon availability

Available in XPath 4.0, XSLT 4.0, and XQuery 4.0. Requires Saxon-PE or Saxon-EE. Implemented since Saxon 13. Available for all platforms.

Notes on the Saxon implementation

To support the BLAKE3 option, the Saxon implementation uses the Blake3 hashing algorithm derived from the implementation in Apache Commons. (See Third party source components and the Blake3 java module for details.)