solana_bpf_loader_program::syscalls

Trait HasherImpl

Source
pub trait HasherImpl {
    type Output: AsRef<[u8]>;

    const NAME: &'static str;

    // Required methods
    fn create_hasher() -> Self;
    fn hash(&mut self, val: &[u8]);
    fn result(self) -> Self::Output;
    fn get_base_cost(compute_budget: &ComputeBudget) -> u64;
    fn get_byte_cost(compute_budget: &ComputeBudget) -> u64;
    fn get_max_slices(compute_budget: &ComputeBudget) -> u64;
}

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Required Methods§

Source

fn create_hasher() -> Self

Source

fn hash(&mut self, val: &[u8])

Source

fn result(self) -> Self::Output

Source

fn get_base_cost(compute_budget: &ComputeBudget) -> u64

Source

fn get_byte_cost(compute_budget: &ComputeBudget) -> u64

Source

fn get_max_slices(compute_budget: &ComputeBudget) -> u64

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl HasherImpl for Blake3Hasher

Source§

const NAME: &'static str = "Blake3"

Source§

type Output = Hash

Source§

impl HasherImpl for Keccak256Hasher

Source§

const NAME: &'static str = "Keccak256"

Source§

type Output = Hash

Source§

impl HasherImpl for Sha256Hasher

Source§

const NAME: &'static str = "Sha256"

Source§

type Output = Hash