<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.sha1.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.sha1</api:function-name><api:suggest>xdmp.sha1</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>sha1</api:suggest><api:function-link mode="xquery" fullname="xdmp:sha1">/apidoc/8.0/xdmp:sha1.xml</api:function-link><api:function mode="javascript" name="sha1" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.sha1"><api:summary>
  Calculates the SHA1 hash of the given argument.
</api:summary><api:params><api:param name="data" type="item()"><api:param-description>
    Data to be hashed. Must be xs:string or a binary node.
  </api:param-description><api:param-name>data</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="encoding" type="xs:string" optional="true"><api:param-description>
    Encoding format for the output string, must be "hex" for hexadecimal
    or "base64". Default is "hex".
  </api:param-description><api:param-name>encoding</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>String</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.sha1("foo");
  =&gt; "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
 </pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.sha1("foo", "base64");
  =&gt; "C+7Hteo/D9vJXQ3UfzxbwnXaijM="
 </pre></api:example></api:function></api:function-page>