mirror of
https://github.com/chancehudson/poseidon-lite.git
synced 2026-01-10 04:47:56 -05:00
19b785efffcbd31e32281e1692b48fd4590b4eba
poseidon-lite 
A 0 dependence poseidon implementation over alt_bn128 (aka BN254).
Warning
This implementation uses the native javascript BigInt which is vulnerable to timing attacks.
This implementation has not been audited.
Use
npm i poseidon-lite
import { poseidon2 } from 'poseidon-lite'
// pass an array to the function
// array length must be equal to the function name
// returns a BigInt
const hash = poseidon2(['0x01', '0x02'])
Individual import
import { poseidon2 } from 'poseidon-lite/poseidon2'
const hash = poseidon2(['0x01', '0x02'])
Build
npm i
npm run build
npm test
License
Versions >=0.2.0 are MIT
Versions <0.2.0 are GPL-3.0
Description
Languages
JavaScript
100%