Loading TOC...

MarkLogic 9 Product Documentation
xdmp.crypt

xdmp.crypt(
   password as String,
   salt as String
) as String

Summary

Calculates the password hash for the given password and salt.

Parameters
password String to be hashed.
salt 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.

Usage Notes

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.

Example

  xdmp.crypt("123abc","admin");
  => "arQEnpM6JHR8vY4n3e5gr0"

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.