Module hash

Module hash 

Source
Expand description

In Git, the SHA-1 hash algorithm is widely used to generate unique identifiers for Git objects. Each Git object corresponds to a unique SHA-1 hash value, which is used to identify the object’s location in the Git internal and mega database.

Structs§

HashKindGuard
A guard to reset the hash kind after the test

Enums§

HashKind
The SHA1 struct, encapsulating a [u8; 20] array, is specifically designed to represent Git hash IDs. In Git’s context, these IDs are 40-character hexadecimal strings generated via the SHA-1 algorithm. Each Git object receives a unique hash ID based on its content, serving as an identifier for its location within the Git internal database. Utilizing a dedicated struct for these hash IDs enhances code readability and maintainability by providing a clear, structured format for their manipulation and storage.
ObjectHash

Functions§

get_hash_kind
Retrieves the hash kind for the current thread.
set_hash_kind
set_hash_kind_for_test
Sets the hash kind for the current thread and returns a guard to reset it later.

Type Aliases§

SHA1