<apidoc:module name="Crypt" category="Crypt" xmlns:apidoc="http://marklogic.com/xdmp/apidoc"><apidoc:summary access="public">
Builtin functions relating to cryptography.
</apidoc:summary><apidoc:function name="crypt" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Calculates the password hash for the given password and salt.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="password" type="xs:string" optional="false">
    String to be hashed.
  </apidoc:param>
      <apidoc:param name="salt" type="xs:string" optional="false">
    Salt to avoid 1:1 mapping from passwords to hashes.
    Only the first 8 characters of the salt are significant; any 
    characters beyond the eighth are ignored.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:string</apidoc:return>
    <apidoc:usage>
<p xmlns="http://www.w3.org/1999/xhtml">You typically use the username as the salt, which ensures that no two 
hash values will be the same, even if different users have the same 
password.</p>
</apidoc:usage>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp:crypt("123abc","admin")
  =&gt; "arQEnpM6JHR8vY4n3e5gr0"
 </pre></apidoc:example>
  </apidoc:function><apidoc:function name="md5" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Calculates the md5 hash of the given argument.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="encoded" type="xs:string" optional="false">
    String to be hashed.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:string</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp:md5("foo")
  =&gt; "acbd18db4cc2f85cedef654fccc4a4d8"
 </pre></apidoc:example>
  </apidoc:function></apidoc:module>