Enum mhash::MultiHashVariant
[−]
[src]
pub enum MultiHashVariant { Identity, Sha1, Sha2_256, Sha2_512, Sha3_512, Sha3_384, Sha3_256, Sha3_224, Shake128, Shake256, Blake2B, Blake2S, ApplicationSpecific { code: usize, }, // some variants omitted }
The possible multihash variants.
Variants
Identity
A straight copy of the data supposedly hashed. May be a prefix rather than a full copy.
Sha1
A 160-bit SHA-1 digest.
Sha2_256
A 256-bit SHA-2 digest.
Sha2_512
A 512-bit SHA-2 digest.
Sha3_512
A 512-bit SHA-3 digest.
Sha3_384
A 384-bit SHA-3 digest.
Sha3_256
A 256-bit SHA-3 digest.
Sha3_224
A 224-bit SHA-3 digest.
Shake128
A variable size SHAKE-128 digest.
Shake256
A variable size SHAKE-256 digest.
Blake2B
A 512-bit BLAKE2b digest.
Blake2S
A 256-bit BLAKE2s digest.
ApplicationSpecific
An application specific MultiHash variant.
Fields of ApplicationSpecific
code: usize | The application specific code for this variant, must be in the range [0x0400, 0x040f]. |
Methods
impl MultiHashVariant
[src]
fn from_code(code: usize) -> Result<MultiHashVariant>
Returns the multihash variant that the given code refers to, validates that the code is known or an application specific variant.
fn from_code_and_length(code: usize, length: usize) -> Result<MultiHashVariant>
Returns the multihash variant that the given code refers to, validates that the code is known or an application specific variant, and that the length is consistent with the multihash variant the code refers to.
fn check_length(self, length: usize) -> Result<()>
Validates that the length is consistent with this multihash variant.
fn max_len(self) -> usize
The maximum digest length allowed for this multihash variant.
fn code(self) -> usize
The code specifying this multihash variant.
fn name(self) -> &'static str
The string representation of this multihash type.
Trait Implementations
impl Debug for MultiHashVariant
[src]
impl Eq for MultiHashVariant
[src]
impl PartialEq for MultiHashVariant
[src]
fn eq(&self, __arg_0: &MultiHashVariant) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MultiHashVariant) -> bool
This method tests for !=
.
impl Clone for MultiHashVariant
[src]
fn clone(&self) -> MultiHashVariant
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more