No description
  • Rust 83.5%
  • TypeScript 16.5%
Find a file
2022-11-17 14:45:52 +04:00
src 🦀 Hotfixes and add benchmark 2022-11-16 20:20:53 +04:00
.gitignore 🛰️ Initial setup 2022-11-15 15:01:45 +04:00
benchmark.ts Fix candidates names 2022-11-17 14:45:52 +04:00
Cargo.toml 🛰️ Initial setup 2022-11-15 15:01:45 +04:00
LICENSE Initial commit 2022-11-15 11:38:16 +01:00
package.json 🦀 Hotfixes and add benchmark 2022-11-16 20:20:53 +04:00
README.md 🦀 Hotfixes and add benchmark 2022-11-16 20:20:53 +04:00
rust-toolchain.toml 🛰️ Initial setup 2022-11-15 15:01:45 +04:00
tsconfig.json 🛰️ Initial setup 2022-11-15 15:01:45 +04:00
yarn.lock 🦀 Hotfixes and add benchmark 2022-11-16 20:20:53 +04:00

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