1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-10 12:46:04 +02:00
This commit is contained in:
Inanna Malick 2024-04-24 15:29:20 +09:00 committed by GitHub
commit 417f668fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,6 +221,12 @@ fn counter_high(counter: u64) -> u32 {
#[derive(Clone, Copy, Hash)]
pub struct Hash([u8; OUT_LEN]);
/// Provided to allow for construction of magic hash values (eg null commit in git as [0; OUT_LEN])
pub const fn construct_magic_hash(bytes: [u8; OUT_LEN]) -> Hash {
Hash(bytes)
}
impl Hash {
/// The raw bytes of the `Hash`. Note that byte arrays don't provide
/// constant-time equality checking, so if you need to compare hashes,