pub struct Sha512_256(/* private fields */);
Expand description
SHA-512-256: Alias for the sha512_256::Hash
hash type.
Output of the SHA512/256 hash function.
SHA512/256 is a hash function that uses the sha512 algorithm but it truncates the output to 256 bits. It has different initial constants than sha512 so it produces an entirely different hash compared to sha512. More information at https://eprint.iacr.org/2010/548.pdf.
Implementations§
Source§impl Hash
impl Hash
Sourcepub const fn from_byte_array(bytes: [u8; 32]) -> Self
pub const fn from_byte_array(bytes: [u8; 32]) -> Self
Constructs a hash from the underlying byte array.
Sourcepub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
pub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
Zero cost conversion between a fixed length byte array shared reference and a shared reference to this Hash type.
Sourcepub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
pub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Sourcepub fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
pub fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
Copies a byte slice into a hash object.
Sourcepub const fn to_byte_array(self) -> [u8; 32]
pub const fn to_byte_array(self) -> [u8; 32]
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &[u8; 32]
pub const fn as_byte_array(&self) -> &[u8; 32]
Returns a reference to the underlying byte array.
Source§impl Hash
impl Hash
Sourcepub fn from_engine(e: HashEngine) -> Hash
pub fn from_engine(e: HashEngine) -> Hash
Produces a hash from the current state of a given engine.
Sourcepub fn engine() -> HashEngine ⓘ
pub fn engine() -> HashEngine ⓘ
Constructs a new engine.
Sourcepub fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
pub fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash, D::Error>
Source§impl GeneralHash for Hash
impl GeneralHash for Hash
Source§type Engine = HashEngine
type Engine = HashEngine
io::Write
trait, and to never return errors under
any conditions.Source§fn from_engine(e: HashEngine) -> Hash
fn from_engine(e: HashEngine) -> Hash
Source§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Source§impl Hash for Hash
impl Hash for Hash
Source§const DISPLAY_BACKWARD: bool = false
const DISPLAY_BACKWARD: bool = false
Source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Source§fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
from_byte_array
insteadSource§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Source§impl Ord for Hash
impl Ord for Hash
Source§impl PartialOrd for Hash
impl PartialOrd for Hash
impl Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)