pub struct Fingerprint {
pub hash: [u64; 2],
}
Expand description
A 128-bit Fingerprint
is constructed by UMASH as if we had
computed the UmashComponent::Hash
and
UmashComponent::Secondary
functions, and stored them in the
Fingerprint::hash
array in order.
This makes it possible to check a document against a
Fingerprint
by only computing the 64-bit
UmashComponent::Hash
, and comparing that with
Fingerprint::hash[0]
: the comparison gives us less confidence,
but is faster to compute.
Fields§
§hash: [u64; 2]
Implementations§
Source§impl Fingerprint
impl Fingerprint
Sourcepub fn new(hash: u64, secondary: u64) -> Self
pub fn new(hash: u64, secondary: u64) -> Self
Returns a 128-bit Fingerprint
for this hash
and
secondary
value.
Sourcepub fn hash(&self) -> u64
pub fn hash(&self) -> u64
Returns the UmashComponent::Hash
component of the fingerprint.
Sourcepub fn secondary(&self) -> u64
pub fn secondary(&self) -> u64
Returns the UmashComponent::Secondary
component of the
fingerprint.
Sourcepub fn component(&self, which: UmashComponent) -> u64
pub fn component(&self, which: UmashComponent) -> u64
Returns the which
component of the fingerprint.
Trait Implementations§
Source§impl Clone for Fingerprint
impl Clone for Fingerprint
Source§fn clone(&self) -> Fingerprint
fn clone(&self) -> Fingerprint
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Fingerprint
impl Debug for Fingerprint
Source§impl Hash for Fingerprint
impl Hash for Fingerprint
Source§impl Ord for Fingerprint
impl Ord for Fingerprint
Source§fn cmp(&self, other: &Fingerprint) -> Ordering
fn cmp(&self, other: &Fingerprint) -> Ordering
1.21.0 · 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 PartialEq for Fingerprint
impl PartialEq for Fingerprint
Source§impl PartialOrd for Fingerprint
impl PartialOrd for Fingerprint
impl Copy for Fingerprint
impl Eq for Fingerprint
impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnwindSafe for Fingerprint
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