[−][src]Struct exonum_crypto::Hash
The result of applying the SHA-256 hash function to data.
This function splits the input data into blocks and runs each block through a cycle of 64 iterations. The result of the function is a hash 256 bits or 32 bytes in length.
Examples
The example below generates the hash of the indicated data.
use exonum_crypto::Hash; let data = [1, 2, 3]; let hash_from_data = exonum_crypto::hash(&data); let default_hash = Hash::default();
Methods
impl Hash
[src]
impl Hash
[src]
pub fn new(bytes_array: [u8; 32]) -> Self
[src]
Creates a new instance from bytes array.
pub fn from_slice(bytes_slice: &[u8]) -> Option<Self>
[src]
Creates a new instance from bytes slice.
pub fn as_bytes(&self) -> [u8; 32]
[src]
Copies bytes from this instance.
pub fn to_hex(&self) -> String
[src]
Returns a hex representation of binary data.
Lower case letters are used (e.g. f9b4ca
).
Trait Implementations
impl AsRef<[u8]> for Hash
[src]
impl Clone for Hash
[src]
impl Copy for Hash
[src]
impl Debug for Hash
[src]
impl Default for Hash
[src]
impl<'de> Deserialize<'de> for Hash
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for Hash
[src]
impl Eq for Hash
[src]
impl FromHex for Hash
[src]
impl Hash for Hash
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Index<Range<usize>> for Hash
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: Range<usize>) -> &[u8]
[src]
impl Index<RangeFrom<usize>> for Hash
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeFull> for Hash
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
impl Index<RangeTo<usize>> for Hash
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeTo<usize>) -> &[u8]
[src]
impl Ord for Hash
[src]
fn cmp(&self, other: &Hash) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Hash> for Hash
[src]
impl PartialOrd<Hash> for Hash
[src]
fn partial_cmp(&self, other: &Hash) -> Option<Ordering>
[src]
fn lt(&self, other: &Hash) -> bool
[src]
fn le(&self, other: &Hash) -> bool
[src]
fn gt(&self, other: &Hash) -> bool
[src]
fn ge(&self, other: &Hash) -> bool
[src]
impl ProtobufConvert for Hash
[src]
type ProtoStruct = Hash
Type of the protobuf clone of Self
fn to_pb(&self) -> Hash
[src]
fn from_pb(pb: Hash) -> Result<Self, Error>
[src]
impl Serialize for Hash
[src]
impl StructuralEq for Hash
[src]
impl StructuralPartialEq for Hash
[src]
Auto Trait Implementations
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,