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

task.mdevals/scenario-9/

High-Performance Hash Benchmark Tool

A command-line tool for benchmarking hash computation performance on large files with memory-efficient processing.

Capabilities

File Reading and Processing

  • Reads a file from disk in 64KB chunks to minimize memory usage @test
  • Processes files larger than 100MB without loading entire content into memory @test

Hash Computation

  • Computes hash digest for the entire file content using incremental updates @test
  • Returns the final hash as a hexadecimal string @test

Performance Metrics

  • Tracks and reports total bytes processed @test
  • Measures and reports processing time in milliseconds @test

Implementation

@generates

API

/**
 * Benchmarks hash computation on a file.
 *
 * @param filePath - Path to the file to hash
 * @returns Object containing hash, bytes processed, and time taken
 */
export function benchmarkHash(filePath: string): Promise<{
  hash: string;
  bytesProcessed: number;
  timeMs: number;
}>;

/**
 * Converts a byte array to hexadecimal string.
 *
 * @param bytes - Byte array to convert
 * @returns Hexadecimal string representation
 */
export function toHex(bytes: Uint8Array): string;

Dependencies { .dependencies }

@stablelib/sha256 { .dependency }

Provides SHA-256 cryptographic hash function with efficient streaming support.

Install with Tessl CLI

npx tessl i tessl/npm-stablelib--sha256

tile.json