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-3/

File Integrity Verifier

A utility that computes cryptographic checksums for files to verify their integrity.

Capabilities

Compute checksum for a file

  • When given a file path, the verifier reads the file content and returns its cryptographic checksum as a hexadecimal string @test
  • When the file is empty, the verifier returns the checksum for empty data @test

Handle file errors

  • When the file does not exist, the verifier throws an error @test

Implementation

@generates

API

/**
 * Computes a cryptographic checksum for the given file.
 *
 * @param filePath - Path to the file to verify
 * @returns A hexadecimal string representing the file's checksum
 * @throws Error if the file cannot be read
 */
export function computeFileChecksum(filePath: string): Promise<string>;

Dependencies { .dependencies }

@stablelib/sha256 { .dependency }

Provides cryptographic hashing support.

fs { .dependency }

Provides file system operations for reading files.

Install with Tessl CLI

npx tessl i tessl/npm-stablelib--sha256

tile.json