Skip to main content

Module hash

Module hash 

Source
Expand description

Hash utilities for Git objects with selectable algorithms (SHA-1 and SHA-256). Hash kind is stored thread-locally; set once at startup to match your repository format. Defaults to SHA-1.

Structs§

HashKindGuard
A guard to reset the hash kind after the test

Enums§

ArchivedHashKind
An archived HashKind
ArchivedObjectHash
An archived ObjectHash
HashKind
Supported hash algorithms for object IDs (selector only, no data attached). Used to configure which hash algorithm to use globally (thread-local). Defaults to SHA-1.
HashKindResolver
The resolver for an archived HashKind
ObjectHash
Concrete object ID value carrying the bytes for the selected algorithm (SHA-1 or SHA-256). Used for Git object hashes. Supports conversion to/from hex strings, byte slices, and stream reading.
ObjectHashResolver
The resolver for an archived ObjectHash

Functions§

get_hash_kind
Retrieves the hash kind for the current thread.
set_hash_kind
Set the thread-local hash kind (configure once at startup to match repo format).
set_hash_kind_for_test
Sets the hash kind for the current thread and returns a guard to reset it later.