CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-stablelib--sha256

SHA-256 cryptographic hash function implementation for TypeScript and JavaScript

91

0.98x
Overview
Eval results
Files

rubric.jsonevals/scenario-10/

{
  "context": "This criteria evaluates how well the engineer uses @stablelib/sha256's explicit output buffer control capability to implement an efficient hash buffer pool manager. The focus is on proper usage of the finish() method to write hash results to pre-allocated buffers, combined with the SHA256 class for hash computation.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "SHA256 class usage",
      "description": "Uses the SHA256 class from @stablelib/sha256 to create hasher instances for computing hashes",
      "max_score": 15
    },
    {
      "name": "finish() method usage",
      "description": "Uses the finish(out) method to write hash output directly to pre-allocated buffers instead of using digest() which allocates new buffers",
      "max_score": 40
    },
    {
      "name": "Buffer pre-allocation",
      "description": "Pre-allocates Uint8Array buffers of correct size (32 bytes for SHA-256) during pool initialization",
      "max_score": 15
    },
    {
      "name": "update() method",
      "description": "Uses the update(data) method to feed input data to the hasher before finalizing",
      "max_score": 10
    },
    {
      "name": "Buffer reuse pattern",
      "description": "Implements proper buffer pool management where buffers are acquired from pool, used with finish(), and returned to pool for reuse",
      "max_score": 15
    },
    {
      "name": "Pool exhaustion handling",
      "description": "Correctly handles the case when all buffers are in use by throwing an error or providing appropriate feedback",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-stablelib--sha256

tile.json