{"_id":"@taceo/poseidon2","_rev":"3-cf5a561a9992bd55d16c0bc4fe0cb345","name":"@taceo/poseidon2","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@taceo/poseidon2","version":"0.2.0","keywords":["poseidon2","bn254","hash","zk","cryptography","sponge"],"license":"MIT","_id":"@taceo/poseidon2@0.2.0","maintainers":[{"name":"fgruber","email":"gruber@taceo.io"},{"name":"dkales","email":"kales@taceo.io"}],"homepage":"https://github.com/TaceoLabs/oprf-client-js#readme","bugs":{"url":"https://github.com/TaceoLabs/oprf-client-js/issues"},"dist":{"shasum":"5cb5e1c585d1c37550e95cd96da046e3187b3ea3","tarball":"https://registry.npmjs.org/@taceo/poseidon2/-/poseidon2-0.2.0.tgz","fileCount":9,"integrity":"sha512-+EyFO7zaRrlsdzNEvzTLELDkrgjUgZgSlxGUSQghmmtlZ14nZklYX7D+gecyOkVe/47AGDtA+uZ9sdXiNB8rng==","signatures":[{"sig":"MEUCIQD80dn1mrSoJFJiP+b2t91DgjOLGvMfB+vAuGqZYeMZNwIgGavmmMjB3PiwCAoGvXiR1OoD8FCNbqQjGhe/BBqi9A0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":346238},"main":"./dist/index.cjs","type":"module","_from":"file:taceo-poseidon2-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"eslint src test","test":"vitest run","build":"tsup","test:watch":"vitest"},"_npmUser":{"name":"dkales","email":"kales@taceo.io"},"_resolved":"/tmp/936be314010df0aff91bb857a88886b8/taceo-poseidon2-0.2.0.tgz","_integrity":"sha512-+EyFO7zaRrlsdzNEvzTLELDkrgjUgZgSlxGUSQghmmtlZ14nZklYX7D+gecyOkVe/47AGDtA+uZ9sdXiNB8rng==","repository":{"url":"git+https://github.com/TaceoLabs/oprf-client-js.git","type":"git","directory":"packages/poseidon2"},"_npmVersion":"11.5.1","description":"Poseidon2 hash function over the BN254 scalar field (state sizes t=2,3,4,8,12,16)","directories":{},"sideEffects":false,"_nodeVersion":"24.6.0","dependencies":{"@noble/curves":"^2.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^4.0.18","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/poseidon2_0.2.0_1773066845610_0.6298931476954039","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@taceo/poseidon2@0.2.1","dist":{"shasum":"e12747b4b30c46148860ef813df7ed40e2b33838","tarball":"https://registry.npmjs.org/@taceo/poseidon2/-/poseidon2-0.2.1.tgz","fileCount":12,"integrity":"sha512-Q3tikVvVXkqknsMY6ULWzxLwCiqzamahPPooEAdmCMkYZ1W/ZQMzYX/Qyt5iBf7kKEJo03k5bwrNA088QztVVQ==","signatures":[{"sig":"MEYCIQDKdzXxX5CzuU8yJnTxRpbCnnhn5LutTMiNyTm8J3Nw2AIhAJ7AzEekdhH9VSUmfubnXGXJxtRG0ckpjb8+TMsXgrjx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCOCyRXOo3ncJsArWKsHGLZkCY4pJqabDLs/8axTIpXdwIgA/koHSKrk6NEGS89o8gB5BfMc12oNmpyhDqiUL48EDw="}],"unpackedSize":335925},"main":"./dist/index.cjs","name":"@taceo/poseidon2","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"license":"MIT","scripts":{"lint":"eslint src test","test":"vitest run","build":"tsdown","test:watch":"vitest"},"version":"0.2.1","_npmUser":{"name":"dkales","email":"kales@taceo.io"},"keywords":["poseidon2","bn254","hash","zk","cryptography","sponge"],"repository":{"url":"https://github.com/TaceoLabs/oprf-client-js","type":"git","directory":"packages/poseidon2"},"description":"Poseidon2 hash function over the BN254 scalar field (state sizes t=2,3,4,8,12,16)","directories":{},"maintainers":[{"name":"fgruber","email":"gruber@taceo.io"},{"name":"dkales","email":"kales@taceo.io"},{"name":"0xthemis","email":"nieddu@taceo.io"}],"sideEffects":false,"dependencies":{"@noble/curves":"^2.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.23.7","vitest":"^5.1.0","typescript":"^7.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/poseidon2_0.2.1_1794927543881_0.11887918429444666"}}},"time":{"created":"2026-03-09T14:34:05.492Z","modified":"2026-11-17T14:59:04.334Z","0.2.0":"2026-03-09T14:34:05.813Z","0.2.1":"2026-11-17T14:59:03.987Z"},"license":"MIT","keywords":["poseidon2","bn254","hash","zk","cryptography","sponge"],"repository":{"url":"https://github.com/TaceoLabs/oprf-client-js","type":"git","directory":"packages/poseidon2"},"description":"Poseidon2 hash function over the BN254 scalar field (state sizes t=2,3,4,8,12,16)","maintainers":[{"name":"fgruber","email":"gruber@taceo.io"},{"name":"dkales","email":"kales@taceo.io"},{"name":"0xthemis","email":"nieddu@taceo.io"}],"readme":"# @taceo/poseidon2\n\nPoseidon2 permutation for the BN254 scalar field, with **parity** to the Rust [taceo-poseidon2](https://github.com/TaceoLabs/poseidon2) crate.\n\nBased on [Poseidon2 (eprint.iacr.org/2023/323)](https://eprint.iacr.org/2023/323). Parameters are compatible with the [HorizenLabs parameter script](https://github.com/HorizenLabs/poseidon2/blob/main/poseidon2_rust_params.sage).\n\n## Installation\n\n```bash\npnpm add @taceo/poseidon2\n```\n\n## Usage\n\n```ts\nimport { bn254 } from '@taceo/poseidon2';\n\n// State sizes t=2, t=3, t=4, t=8, t=12, t=16\nconst state = [0n, 1n, 2n, 3n];\nconst out = bn254.t4.permutation(state); // returns new array\nbn254.t4.permutationInPlace(state); // mutates in place\n```\n\nField elements are BN254 scalar field elements (`bigint` in the range `[0, p)`), we use `@noble/curves`’s `bn254_Fr` internally.\n\n## API\n\n- **`bn254.t2` … `bn254.t16`** — permutation for state size 2, 3, 4, 8, 12, 16\n  - **`permutation(state: readonly bigint[]): bigint[]`** — returns new state\n  - **`permutationInPlace(state: bigint[]): void`** — mutates state\n\n## License\n\nMIT or Apache 2.0\n","readmeFilename":""}