Skip to main content

Crypto module · hash implementation

Add a modern digest at the bytes boundary.

SHA256Hash implements the shared Hash API for content addressing, integrity metadata, and compatibility with systems that specify SHA-256.

Use it for integrity

Hash complete content or feed it incrementally.

Use the asynchronous method for a complete buffer, the synchronous method after preload, or the batch method when a source already produces an async iterable of bytes.

Input

ArrayBuffer or async binary batches

Output

SHA-256 digest in the selected encoding

Runtime

Browser and Node.js through the shared API

Security

Digest integrity, not a password hash

Detailed guide

SHA256Hash details

The reference below documents the constructor, preload requirements, and streaming behavior.

SHA256Hash

From-v3.0

Calculates the SHA256 hash.

Interface​

Implements the Hash API.

Methods​

constructor(options?: object)​

Remarks​

  • This transform supports streaming hashing.