pub struct HashConfig {
pub salt: u64,
/* private fields */
}Expand description
Configuration for the hashing system.
Contains the modulus used for finite field arithmetic. The default is a 61-bit Mersenne prime.
Fields§
§salt: u64Prime modulus used for all field operations.
Implementations§
Source§impl HashConfig
impl HashConfig
Sourcepub fn _hash<const K: usize>(self, s: &Vec<u64>) -> [u64; 5]
pub fn _hash<const K: usize>(self, s: &Vec<u64>) -> [u64; 5]
Internal generic hash function.
Computes a polynomial fingerprint of the input using K evaluation points.
§Note
Returns raw byte representation of field outputs.
Sourcepub fn hash122(self, s: &Vec<u64>) -> Vec<u8> ⓘ
pub fn hash122(self, s: &Vec<u64>) -> Vec<u8> ⓘ
122-bit hash (K = 2 evaluations & very small entropy for real usage)
Sourcepub fn hash183(self, s: &Vec<u64>) -> Vec<u8> ⓘ
pub fn hash183(self, s: &Vec<u64>) -> Vec<u8> ⓘ
183-bit hash (K = 3 evaluations & recommended using for better performance)
Sourcepub fn hash244(self, s: &Vec<u64>) -> Vec<u8> ⓘ
pub fn hash244(self, s: &Vec<u64>) -> Vec<u8> ⓘ
244-bit hash (K = 4 evaluations & recommended for most usages)
Sourcepub fn hash305(self, s: &Vec<u64>) -> Vec<u8> ⓘ
pub fn hash305(self, s: &Vec<u64>) -> Vec<u8> ⓘ
305-bit hash (K = 5 evaluations & not recommended for most usages)
Sourcepub fn new(salt: u64) -> HashConfig
pub fn new(salt: u64) -> HashConfig
Creates a new hash configuration using a 61-bit Mersenne prime field.
Trait Implementations§
Source§impl Clone for HashConfig
impl Clone for HashConfig
Source§fn clone(&self) -> HashConfig
fn clone(&self) -> HashConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HashConfig
Auto Trait Implementations§
impl Freeze for HashConfig
impl RefUnwindSafe for HashConfig
impl Send for HashConfig
impl Sync for HashConfig
impl Unpin for HashConfig
impl UnsafeUnpin for HashConfig
impl UnwindSafe for HashConfig
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