<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.crypt.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.crypt</api:function-name><api:suggest>xdmp.crypt</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>crypt</api:suggest><api:function-link mode="xquery" fullname="xdmp:crypt">/apidoc/8.0/xdmp:crypt.xml</api:function-link><api:function mode="javascript" name="crypt" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.crypt"><api:summary>
  Calculates the password hash for the given password and salt.
</api:summary><api:params><api:param name="password" type="xs:string"><api:param-description>
    String to be hashed.
  </api:param-description><api:param-name>password</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="salt" type="xs:string"><api:param-description>
    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.
  </api:param-description><api:param-name>salt</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>String</api:return><api: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>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.crypt("123abc","admin");
  =&gt; "arQEnpM6JHR8vY4n3e5gr0"
</pre></api:example></api:function></api:function-page>