pub struct FingerprintEngine { /* private fields */ }Expand description
Engine for computing and verifying proxy fingerprints.
Implementations§
Source§impl FingerprintEngine
impl FingerprintEngine
Sourcepub fn new(algorithm: FingerprintAlgorithm) -> Self
pub fn new(algorithm: FingerprintAlgorithm) -> Self
Create a new fingerprint engine.
Sourcepub fn with_block_size(self, size: usize) -> Self
pub fn with_block_size(self, size: usize) -> Self
Set the block size for block-based hashing.
Sourcepub fn compute(&self, data: &[u8]) -> Fingerprint
pub fn compute(&self, data: &[u8]) -> Fingerprint
Compute a fingerprint for the given data.
Sourcepub fn compute_and_cache(&mut self, name: &str, data: &[u8]) -> Fingerprint
pub fn compute_and_cache(&mut self, name: &str, data: &[u8]) -> Fingerprint
Compute and cache a fingerprint for a named proxy.
Sourcepub fn verify(&self, data: &[u8], expected: &Fingerprint) -> VerifyResult
pub fn verify(&self, data: &[u8], expected: &Fingerprint) -> VerifyResult
Verify data against a stored fingerprint.
Sourcepub fn get_cached(&self, name: &str) -> Option<&Fingerprint>
pub fn get_cached(&self, name: &str) -> Option<&Fingerprint>
Look up a cached fingerprint by name.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Number of cached fingerprints.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the fingerprint cache.
Auto Trait Implementations§
impl Freeze for FingerprintEngine
impl RefUnwindSafe for FingerprintEngine
impl Send for FingerprintEngine
impl Sync for FingerprintEngine
impl Unpin for FingerprintEngine
impl UnsafeUnpin for FingerprintEngine
impl UnwindSafe for FingerprintEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more