src/ContentHash.bend checks
raw source on the hub · import 0x876fb95e9d05a7c35ecfcf6d39b99754/src/ContentHash.bend as ContentHash
4 imports
import Base import mylsm-lsm-store@0.3.1.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.