The scrypt password-based key derivation function with sync and cancellable async.
Overall
score
98%
{
"context": "This evaluation assesses how effectively the engineer uses scrypt-js's input validation features and error handling mechanisms to build a robust key derivation utility. The criteria focus exclusively on proper usage of the scrypt-js package API.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Imports scrypt function",
"description": "Correctly imports the scrypt() function from the scrypt-js package using require('scrypt-js') or equivalent ES6 import",
"max_score": 5
},
{
"name": "Calls scrypt correctly",
"description": "Invokes scrypt() with all 6 required parameters (password, salt, N, r, p, dkLen) in the correct order",
"max_score": 10
},
{
"name": "Validates N parameter",
"description": "Validates that N is a power of 2 and non-zero, catching scrypt-js errors when invalid N values are passed (scrypt-js enforces this with specific error messages)",
"max_score": 15
},
{
"name": "Validates integer parameters",
"description": "Validates that r, p, and dkLen are integers before passing to scrypt, relying on scrypt-js's parameter validation",
"max_score": 15
},
{
"name": "Validates password format",
"description": "Validates that password is array-like (Buffer, Uint8Array, or ArrayLike<number>) as required by scrypt-js, handling null/undefined and non-array-like inputs",
"max_score": 15
},
{
"name": "Validates salt format",
"description": "Validates that salt is array-like (Buffer, Uint8Array, or ArrayLike<number>) as required by scrypt-js, handling null/undefined and non-array-like inputs",
"max_score": 15
},
{
"name": "Handles scrypt errors",
"description": "Properly catches and handles validation errors thrown by scrypt-js (which uses Error objects with descriptive messages), either propagating them or re-throwing with context",
"max_score": 10
},
{
"name": "Returns proper output",
"description": "Returns the Uint8Array result from scrypt() as a Promise, preserving the scrypt-js return type",
"max_score": 10
},
{
"name": "Async/Promise handling",
"description": "Correctly handles the Promise returned by scrypt() using async/await or .then()/.catch() patterns",
"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