SHA-256 cryptographic hash function implementation for TypeScript and JavaScript
91
Build a password hash manager that securely processes passwords using SHA-256 hashing. The system must properly clean up sensitive data from memory after processing to prevent data leakage.
Your implementation should:
The system will handle sensitive password data. It is critical that no password-related information remains in memory after the hashing operation completes. Your implementation must ensure that all internal buffers and state are properly cleared.
@generates
/**
* Computes the SHA-256 hash of a password string
* @param password - The password to hash
* @returns The SHA-256 hash as a hexadecimal string
*/
export function hashPassword(password: string): string;
/**
* Processes multiple passwords and returns their hashes
* @param passwords - Array of passwords to hash
* @returns Array of SHA-256 hashes as hexadecimal strings
*/
export function hashPasswordBatch(passwords: string[]): string[];Provides SHA-256 cryptographic hashing functionality.
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