Struct bao::hash::Hash [−][src]
pub struct Hash { /* fields omitted */ }
A Bao hash, with constant-time equality.
Methods
impl Hash
[src]
impl Hash
pub fn new(bytes: [u8; 32]) -> Self
[src]
pub fn new(bytes: [u8; 32]) -> Self
Create a new Hash
from an array of bytes.
pub fn as_bytes(&self) -> &[u8; 32]
[src]
pub fn as_bytes(&self) -> &[u8; 32]
Convert the Hash
to a byte array. Note that the array type doesn't provide constant time
equality.
pub fn to_hex(&self) -> ArrayString<[u8; 64]>
[src]
pub fn to_hex(&self) -> ArrayString<[u8; 64]>
Convert the Hash
to a lowercase hexadecimal
ArrayString
.
Trait Implementations
impl Clone for Hash
[src]
impl Clone for Hash
fn clone(&self) -> Hash
[src]
fn clone(&self) -> Hash
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Hash
[src]
impl Copy for Hash
impl PartialEq for Hash
[src]
impl PartialEq for Hash
This implementation is constant time.
fn eq(&self, other: &Hash) -> bool
[src]
fn eq(&self, other: &Hash) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl PartialEq<[u8]> for Hash
[src]
impl PartialEq<[u8]> for Hash
This implementation is constant time, if the slice length is HASH_SIZE
.
fn eq(&self, other: &[u8]) -> bool
[src]
fn eq(&self, other: &[u8]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Eq for Hash
[src]
impl Eq for Hash
impl Debug for Hash
[src]
impl Debug for Hash