sha256: TRet<CHash<_SHA256>>

SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:

  • Trying 2^128 hashes would get 50% chance of collision, using birthday attack.
  • BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
  • Each sha256 hash is executing 2^18 bit operations.
  • Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.

message bytes to hash

Reserved hash options.

Digest bytes.

Hash a message with SHA2-256.

sha256(new Uint8Array([97, 98, 99]));