The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
Build a password hashing utility that works seamlessly across Node.js (CommonJS), AMD/RequireJS environments, and directly in browsers via script tags.
Your module must:
Export a hashPassword function that:
"staticSalt123" (converted to UTF-8 bytes)Work correctly in all three environments:
require() (CommonJS pattern)define()<script> tag loadPreserve any pre-existing global variable with the same name when loaded in browsers
hashPassword("test123") resolves to a 64-character hex string @testhashPassword("myPassword") produces consistent output across multiple calls @testrequire() in Node.js @test@generates
/**
* Hashes a password using scrypt algorithm.
*
* @param {string} password - The password to hash
* @returns {Promise<string>} Promise resolving to 64-character hex string
*/
function hashPassword(password);Provides password-based key derivation functionality.
Install with Tessl CLI
npx tessl i tessl/npm-scrypt-jsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10