pub trait StorageHasher: 'static {
    type Output: AsRef<[u8]>;

    const METADATA: StorageHasher;

    // Required methods
    fn hash(x: &[u8]) -> Self::Output;
    fn max_len<K: MaxEncodedLen>() -> usize;
}
Expand description

Hasher to use to hash keys to insert to storage.

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn hash(x: &[u8]) -> Self::Output

source

fn max_len<K: MaxEncodedLen>() -> usize

The max length of the final hash, for the given key type.

Implementors§

source§

impl StorageHasher for Blake2_128

source§

const METADATA: StorageHasher = metadata::StorageHasher::Blake2_128

§

type Output = [u8; 16]

source§

impl StorageHasher for Blake2_128Concat

source§

const METADATA: StorageHasher = metadata::StorageHasher::Blake2_128Concat

§

type Output = Vec<u8, Global>

source§

impl StorageHasher for Blake2_256

source§

const METADATA: StorageHasher = metadata::StorageHasher::Blake2_256

§

type Output = [u8; 32]

source§

impl StorageHasher for Identity

source§

const METADATA: StorageHasher = metadata::StorageHasher::Identity

§

type Output = Vec<u8, Global>

source§

impl StorageHasher for Twox64Concat

source§

const METADATA: StorageHasher = metadata::StorageHasher::Twox64Concat

§

type Output = Vec<u8, Global>

source§

impl StorageHasher for Twox128

source§

const METADATA: StorageHasher = metadata::StorageHasher::Twox128

§

type Output = [u8; 16]

source§

impl StorageHasher for Twox256

source§

const METADATA: StorageHasher = metadata::StorageHasher::Twox256

§

type Output = [u8; 32]