Struct scrypto::prelude::radix_engine_common::crypto::HashAccumulator
source · pub struct HashAccumulator {
inner: CoreWrapper<CtVariableCoreWrapper<Blake2bVarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>,
input_size: usize,
}
Expand description
Represents a 32-byte hash accumulator.
Fields§
§inner: CoreWrapper<CtVariableCoreWrapper<Blake2bVarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>
§input_size: usize
Implementations§
source§impl HashAccumulator
impl HashAccumulator
pub fn new() -> HashAccumulator
sourcepub fn update(self, data: impl AsRef<[u8]>) -> HashAccumulator
pub fn update(self, data: impl AsRef<[u8]>) -> HashAccumulator
Effectively concatenates data
to the payload-to-be-hashed
pub fn update_no_chain(&mut self, data: impl AsRef<[u8]>)
pub fn input_length(&self) -> usize
pub fn finalize(self) -> Hash
Auto Trait Implementations§
impl RefUnwindSafe for HashAccumulator
impl Send for HashAccumulator
impl Sync for HashAccumulator
impl Unpin for HashAccumulator
impl UnwindSafe for HashAccumulator
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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