Pedersen Hash
This library exposes the following functions:
pub fn pedersen(x: &str, y: &str) -> String
: Geometry version.
pub fn starknet_pedersen(x: Vec<u8>, y: Vec<u8>) -> String
: Starknet reference implementation
pub fn starknet_pedersen_cairo(x: Vec<u8>, y: Vec<u8>) -> String
: Cairo output format of starknet_pedersen
.
Note: pedersen
output is padded to 32 bytes. If an hex string is passed to it, it's expected to be big endian. Otherwise, all inputs are little-endian.
Building pkg
$> wasm-pack build --target nodejs --release
Running the benchmark
$> ts-node benchmark.ts