MCPcopy
hub / github.com/dcodeIO/bcrypt.js / hashSync

Function hashSync

index.js:153–159  ·  view source on GitHub ↗
(password, salt)

Source from the content-addressed store, hash-verified

151 * @returns {string} Resulting hash
152 */
153export function hashSync(password, salt) {
154 if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS;
155 if (typeof salt === "number") salt = genSaltSync(salt);
156 if (typeof password !== "string" || typeof salt !== "string")
157 throw Error("Illegal arguments: " + typeof password + ", " + typeof salt);
158 return _hash(password, salt);
159}
160
161/**
162 * Asynchronously generates a hash for the given password.

Callers 2

test-import.tsFile · 0.90
compareSyncFunction · 0.85

Calls 2

genSaltSyncFunction · 0.85
_hashFunction · 0.85

Tested by

no test coverage detected