pub enum Digest {
BLAKE2s,
MD5,
RMD160,
SHA1,
SHA256,
SHA512,
}Expand description
Variants§
BLAKE2s
Implements BLAKE2s hash support using Blake2s256 from the
blake2 crate.
MD5
Implements MD5 hash support using md5 from the md5
crate.
RMD160
Implements RMD160 hash support using Ripemd160 from the ripemd
crate.
SHA1
Implements SHA1 hash support using Sha1 from the sha1 crate.
SHA256
Implements SHA256 hash support using Sha256 from the sha2 crate.
This isn’t used anywhere in pkgsrc as of time of implementation, but as
we are already importing the sha2 crate we may as well support it.
SHA512
Implements SHA512 hash support using Sha512 from the sha2 crate.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn hash_file<R: Read>(&self, reader: &mut R) -> DigestResult<String>
pub fn hash_file<R: Read>(&self, reader: &mut R) -> DigestResult<String>
Hash a file. The full contents of the file are hashed, it is not processed in any way. Suitable for distfiles.
Sourcepub fn hash_patch<R: Read>(&self, reader: &mut R) -> DigestResult<String>
pub fn hash_patch<R: Read>(&self, reader: &mut R) -> DigestResult<String>
Hash a pkgsrc patch file. Any lines containing $NetBSD are skipped,
so that CVS Id expansion does not change the hash.
Sourcepub fn hash_str(&self, s: &str) -> DigestResult<String>
pub fn hash_str(&self, s: &str) -> DigestResult<String>
Hash a string. Mostly useful for testing.
Trait Implementations§
Source§impl FromStr for Digest
impl FromStr for Digest
Source§type Err = DigestError
type Err = DigestError
impl Copy for Digest
impl Eq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.