Skip to main content

Crate light_hasher

Crate light_hasher 

Source
Expand description

§light-hasher

Trait for generic hash function usage on Solana.

TypeDescription
HasherTrait with hash, hashv, and zero_bytes
PoseidonPoseidon hash over BN254
KeccakKeccak-256 hash
Sha256SHA-256 hash
DataHasherTrait to hash structured data
HasherErrorError type for hash operations
hash_chainSequential hash chaining
hash_to_field_sizeTruncate hash output to BN254 field size
zero_bytesPrecomputed zero-leaf hashes per hasher

Re-exports§

pub use keccak::Keccak;
pub use poseidon::Poseidon;
pub use sha256::Sha256;
pub use crate::errors::HasherError;

Modules§

bigint
errors
hash_chain
hash_to_field_size
keccak
poseidon
sha256
syscalls
This module is a partial copy from solana-program, which is licensed under Apache License 2.0.
to_byte_array
vec
A contiguous growable array type with heap-allocated contents, written Vec<T>.
zero_bytes
zero_indexed_leaf

Macros§

impl_to_byte_array_for_array
Example usage: impl_to_byte_array_for_array! { MyCustomType, 1 => [0], 2 => [0, 1] }
vec
Creates a Vec containing the arguments.

Structs§

String
A UTF-8–encoded, growable string.
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Constants§

HASH_BYTES

Traits§

DataHasher
Hasher

Type Aliases§

Hash