Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

CommutativeHasher

Computes a commutative hash of a sorted pair of felt252 values.

This is usually implemented as an extension of a non-commutative hash function, like Pedersen or Poseidon, returning the hash of the concatenation of the two values by first sorting them.

Frequently used when working with merkle proofs.

Fully qualified path: openzeppelin_merkle_tree::hashes::CommutativeHasher

pub trait CommutativeHasher

Trait functions

commutative_hash

Fully qualified path: openzeppelin_merkle_tree::hashes::CommutativeHasher::commutative_hash

fn commutative_hash(a: felt252, b: felt252) -> felt252