(password, salt)
| 151 | * @returns {string} Resulting hash |
| 152 | */ |
| 153 | export 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. |
no test coverage detected