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

Object Safety§

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