Skip to main content

hash_container_bytes

Function hash_container_bytes 

Source
pub fn hash_container_bytes(format: ObjectFormat, data: &[u8]) -> Digest
Expand description

Fast container-trailer digest for non-object Git container files (.git/index, .pack, .idx, commit-graph, multi-pack-index).

Uses runtime-dispatched hardware SHA-1 / SHA-256 (ring::digest, SHA-NI/AVX2/ARMv8) without Marc Stevens collision-detection state tracking, matching stock Git’s separation between object-ID hashing and container integrity trailers.

OBJ-004 invariant: NEVER use this function to compute or verify Git object OIDs (blob, tree, commit, tag). All Git object identity MUST use hash_object or Hasher (sha1collisiondetection).