~/bend-docscommunity

src/ContentHash.bend checks

raw source on the hub · import ber-core-store@0.1.2.0/src/ContentHash.bend as ContentHash

4 imports
import Base
import mylsm-lsm-store@0.3.2.0/src/hub_sha/sha256.bend as ProvenSha
import bend-codec-lib@0.2.0.0/utf8.bend as Utf8Lib
import bend-codec-lib@0.2.0.0/bytes.bend as ByteLib

Definitions

def bytes_data source · line 11 · raw

@byte_box:0x888714bde93f46c139372bb9fdc57a19/bytes.Bytes -> List<&2, U32>

SHA-256 hex of UTF-8 text. ProvenSha/Utf8 cores are trusted upstream (FIPS 180-4 machine-checked; closed roundtrips proved); this module owns only the byte-list plumbing between them, covered by the differential check vs Python hashlib at the 55/56/64-byte padding boundaries. Unwraps the byte box into the word list the hash core consumes.

def digest_from_encode_result source · line 17 · raw

@encode_result:Result<&2, &2, 0x888714bde93f46c139372bb9fdc57a19/utf8.Utf8.Error, 0x888714bde93f46c139372bb9fdc57a19/bytes.Bytes> -> String

Hashes valid encodings; unencodable input yields a fixed sentinel string.

def compute_sha256_hex source · line 25 · raw

@input_text:String -> String

"INVALID_UTF8_INPUT" on unencodable text; never fails on valid input.