pub enum HashType {
Md5(Digest<16>),
SHA1(Digest<20>),
SHA256(Digest<32>),
SHA384(Digest<48>),
SHA512(Digest<64>),
}Expand description
The hash by which a sample is identified
Variants§
Md5(Digest<16>)
MD5
SHA1(Digest<20>)
SHA-1
SHA256(Digest<32>)
SHA-256, assumed to be SHA2-256
SHA384(Digest<48>)
SHA-384, assumed to be SHA2-384
SHA512(Digest<64>)
SHA-512, assumed to be SHA2-512
Implementations§
Source§impl HashType
impl HashType
Sourcepub fn from_content_digest_header(s: &str) -> Result<Self, DigestError>
pub fn from_content_digest_header(s: &str) -> Result<Self, DigestError>
Get the hash type from the content-digest header.
§Errors
Returns an error if the header is malformed or if the base64 decoding fails.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Return the name of the hash type, used to decide on the database field to find the match
Sourcepub fn content_digest_header(&self) -> String
pub fn content_digest_header(&self) -> String
Create a content-digest header from the hash type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HashType
impl<'de> Deserialize<'de> for HashType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for HashType
impl Ord for HashType
Source§impl PartialOrd for HashType
impl PartialOrd for HashType
impl Eq for HashType
impl StructuralPartialEq for HashType
Auto Trait Implementations§
impl Freeze for HashType
impl RefUnwindSafe for HashType
impl Send for HashType
impl Sync for HashType
impl Unpin for HashType
impl UnwindSafe for HashType
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