Skip to main content

decode_ref_wire

Function decode_ref_wire 

Source
pub fn decode_ref_wire(data: &[u8]) -> Option<Hash>
Expand description

Decode a ref wire blob into a Hash. Tolerates a trailing newline / \r / ASCII whitespace (so files round-tripped through a Windows editor still parse), but rejects uppercase hex per SPEC-REFS §1.

Returns None for any malformed input; callers wrap the absent case into a domain-specific RefError::InvalidRef.