Expand description
Synchronous SHA-256 hashing.
GraphReFly’s public substrate exposes sha256Hex (cache-key /
content-addressing helper used by versioning, snapshot paths, and the
presentation-layer adapters). The TS reference impl is async only
because crypto.subtle.digest returns a Promise — there is nothing
intrinsically async about SHA-256.
Per the Rust-port invariant “No async runtime in Core” (CLAUDE.md
invariant 4 / D070 / D077), the hashing itself stays fully
synchronous here. The async-everywhere wrapping demanded by the
Impl parity contract is applied only at the napi boundary
(graphrefly-bindings-js), never in this crate.
@module
Functions§
- sha256_
hex - Hex-encode the SHA-256 digest of
bytes. Pure, synchronous, no allocation beyond the 64-char outputString. Mirrors the TSsha256Hexbyte semantics: the caller is responsible for encoding astringinput to UTF-8 bytes before calling (the napi boundary does this).