SHA-256 cryptographic hash function implementation for TypeScript and JavaScript
91
{
"context": "This criteria evaluates how well the engineer uses @stablelib/sha256's algorithm constants (DIGEST_LENGTH and BLOCK_SIZE) to implement buffer validation and size calculation functions. The focus is on correct usage of these exported constants rather than hardcoding values.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import DIGEST_LENGTH",
"description": "Imports the DIGEST_LENGTH constant from @stablelib/sha256",
"max_score": 20
},
{
"name": "Import BLOCK_SIZE",
"description": "Imports the BLOCK_SIZE constant from @stablelib/sha256",
"max_score": 20
},
{
"name": "Use DIGEST_LENGTH for validation",
"description": "Uses DIGEST_LENGTH constant (not hardcoded 32) in isValidDigestSize function to check buffer length",
"max_score": 15
},
{
"name": "Use DIGEST_LENGTH for allocation",
"description": "Uses DIGEST_LENGTH constant (not hardcoded 32) in allocateDigestBuffer function to create correctly-sized buffer",
"max_score": 15
},
{
"name": "Use BLOCK_SIZE for alignment",
"description": "Uses BLOCK_SIZE constant (not hardcoded 64) in isBlockAligned function to check alignment",
"max_score": 15
},
{
"name": "Use BLOCK_SIZE for calculations",
"description": "Uses BLOCK_SIZE constant (not hardcoded 64) in calculateCompleteBlocks function to compute block count",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-stablelib--sha256docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10