0.2.2 • Published 12 months ago

poseidon-lite-with-domain v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

poseidon-lite CircleCI

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-with-domain

import { poseidon2 } from 'poseidon-lite-with-domain'
// pass an array to the function
// array length must be equal to the function name
// returns a BigInt
const domain = 512
const hash = poseidon2(['0x01', '0x02'],domain)

Individual import

import { poseidon2 } from 'poseidon-lite-with-domain/poseidon2'
const domain = 512
const hash = poseidon2(['0x01', '0x02'],domain)

Build

npm i
npm run build
npm test

License

Versions >=0.2.0 are MIT

Versions <0.2.0 are GPL-3.0

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

12 months ago