The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
{
"context": "This criteria evaluates how well the engineer uses the scrypt-js package to create a cross-platform module that works in Node.js, AMD/RequireJS, and browser environments. The focus is on proper usage of scrypt-js APIs and implementing the Universal Module Definition (UMD) pattern.",
"type": "weighted_checklist",
"checklist": [
{
"name": "scrypt function usage",
"description": "Uses the `scrypt` function (or `scrypt.scrypt`) from scrypt-js for asynchronous password hashing, passing all required parameters (password, salt, N, r, p, dkLen) correctly",
"max_score": 25
},
{
"name": "Parameter values",
"description": "Passes correct scrypt parameters as specified: N=1024, r=8, p=1, dkLen=32",
"max_score": 10
},
{
"name": "Input conversion",
"description": "Converts password and salt strings to byte arrays (Buffer or array-like structure) compatible with scrypt-js input requirements",
"max_score": 15
},
{
"name": "Promise handling",
"description": "Correctly handles the Promise returned by the scrypt function, returning it or re-wrapping it appropriately for the hashPassword API",
"max_score": 10
},
{
"name": "Hex encoding output",
"description": "Converts the Uint8Array result from scrypt into a hexadecimal string for the final output",
"max_score": 10
},
{
"name": "CommonJS export",
"description": "Properly detects CommonJS environment (checking for module.exports or exports) and exports the hashPassword function for Node.js require() usage",
"max_score": 10
},
{
"name": "AMD export",
"description": "Properly detects AMD environment (checking for define function with define.amd) and uses define() to export the module for RequireJS usage",
"max_score": 10
},
{
"name": "Browser global export",
"description": "Exports hashPassword as a global variable when loaded in browser via script tag, making it accessible on the window/global object",
"max_score": 5
},
{
"name": "Global preservation",
"description": "Preserves any pre-existing global variable with the same name (using noConflict pattern or similar technique) when loaded in browsers",
"max_score": 5
}
]
}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