pedersen

extern fn pedersen(a: felt252, b: felt252) -> felt252;
Computes the Pedersen hash of two felt252 values. The Pedersen hash function is a collision-resistant cryptographic hash function that takes two field elements as input and produces a single field element as output.

Parameters

  • a: felt252 - The first input value
  • b: felt252 - The second input value

Returns

  • felt252 - The Pedersen hash of the two input values

Example

use core::pedersen::pedersen;

let hash = pedersen(1, 2);
// Result: hash value as felt252
  • HashState - For computing Pedersen hashes of multiple values
  • PedersenTrait - Trait for creating new hash states