Signature
Trait functions
update
Updates the current hash stateself with the given felt252 value and returns a new hash
state.
Signature
Examples
finalize
Takes the current stateself and returns the hash result.
pub trait HashStateTrait
self with the given felt252 value and returns a new hash
state.
fn update(self: S, value: felt252) -> S
use core::pedersen::PedersenTrait;
use core::hash::HashStateTrait;
let mut state = PedersenTrait::new(0);
state = state.update(1);
self and returns the hash result.
fn finalize(self: S) -> felt252
use core::pedersen::PedersenTrait;
use core::hash::HashStateTrait;
let mut state = PedersenTrait::new(0);
let hash = state.finalize();
Was this page helpful?