pub enum HashAlgo {
Sha1,
Sha256,
}Expand description
A Git hash algorithm.
Git supports two object-id hash functions: the historical SHA-1 (20-byte
digests, 40 hex chars) and the newer SHA-256 (32-byte digests, 64 hex
chars). A repository’s algorithm is recorded in extensions.objectformat.
Variants§
Implementations§
Source§impl HashAlgo
impl HashAlgo
Sourcepub const fn hex_len(self) -> usize
pub const fn hex_len(self) -> usize
The hex-encoded digest length (40 for SHA-1, 64 for SHA-256).
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The lowercase name as written in extensions.objectformat.
Sourcepub const fn oid_version(self) -> u8
pub const fn oid_version(self) -> u8
The oid_version byte used in .idx/multi-pack-index headers
(SHA-1 → 1, SHA-256 → 2).
Trait Implementations§
impl Copy for HashAlgo
impl Eq for HashAlgo
Source§impl Ord for HashAlgo
impl Ord for HashAlgo
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for HashAlgo
impl PartialOrd for HashAlgo
impl StructuralPartialEq for HashAlgo
Auto Trait Implementations§
impl Freeze for HashAlgo
impl RefUnwindSafe for HashAlgo
impl Send for HashAlgo
impl Sync for HashAlgo
impl Unpin for HashAlgo
impl UnsafeUnpin for HashAlgo
impl UnwindSafe for HashAlgo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more