Expand description
§light-hasher
Trait for generic hash function usage on Solana.
| Type | Description |
|---|---|
Hasher | Trait with hash, hashv, and zero_bytes |
Poseidon | Poseidon hash over BN254 |
Keccak | Keccak-256 hash |
Sha256 | SHA-256 hash |
DataHasher | Trait to hash structured data |
HasherError | Error type for hash operations |
hash_chain | Sequential hash chaining |
hash_to_field_size | Truncate hash output to BN254 field size |
zero_bytes | Precomputed 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
Veccontaining the arguments.
Structs§
- String
- A UTF-8–encoded, growable string.
- Vec
- A contiguous growable array type, written as
Vec<T>, short for ‘vector’.