/utils/bcrypt

The bcrypt utility module exports methods to hash and compare password stored in the ACL.

The script has been taken from the built distribution of https://github.com/dcodeIO/bcrypt.js

License
  • bcrypt.js (c) 2013 Daniel WirtzReleased under the Apache License, Version 2.0

Methods

(inner) compareSync(s, hash) → {boolean}

Synchronously tests a string against a hash.

Parameters:
NameTypeDescription
sstring

String to compare

hashstring

Hash to test against

Throws:

If an argument is illegal

Type
Error
Returns:

true if matching, otherwise false

Type: 
boolean

(inner) hashSync(s, saltopt) → {string}

Synchronously generates a hash for the given string.

Parameters:
NameTypeAttributesDescription
sstring

String to hash

saltnumber | string<optional>

Salt length to generate or salt to use, default to 10

Returns:

Resulting hash

Type: 
string