{"id":26825085,"url":"https://github.com/chancehudson/poseidon-lite","last_synced_at":"2025-04-28T14:05:42.952Z","repository":{"id":65388520,"uuid":"563676979","full_name":"chancehudson/poseidon-lite","owner":"chancehudson","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-23T03:53:09.000Z","size":2945,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T14:05:36.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/poseidon-lite","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chancehudson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-09T05:03:28.000Z","updated_at":"2025-02-17T22:07:25.000Z","dependencies_parsed_at":"2024-06-19T01:29:21.541Z","dependency_job_id":"cd7f1823-b049-4b19-a199-631fa18cca88","html_url":"https://github.com/chancehudson/poseidon-lite","commit_stats":{"total_commits":39,"total_committers":3,"mean_commits":13.0,"dds":0.05128205128205132,"last_synced_commit":"d66f7178bd68a89135ec2733522a1852cead20a3"},"previous_names":["chancehudson/poseidon-lite","vimwitch/poseidon-lite"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fposeidon-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chancehudson","download_url":"https://codeload.github.com/chancehudson/poseidon-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326836,"owners_count":21571634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-30T10:19:10.782Z","updated_at":"2025-04-28T14:05:42.901Z","avatar_url":"https://github.com/chancehudson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poseidon-lite [![CircleCI](https://dl.circleci.com/status-badge/img/gh/chancehudson/poseidon-lite/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/chancehudson/poseidon-lite/tree/main)\n\nA 0 dependence poseidon implementation over alt_bn128 (aka BN254).\n\n## Warning\n\nThis implementation uses the native javascript `BigInt` which is vulnerable to timing attacks.\n\nThis implementation has **not** been audited.\n\n## Use\n\n`npm i poseidon-lite`\n\n```js\nimport { poseidon2 } from 'poseidon-lite'\n// pass an array to the function\n// array length must be equal to the function name\n// returns a BigInt\nconst hash = poseidon2(['0x01', '0x02'])\n```\n\n### Individual import\n\n```js\nimport { poseidon2 } from 'poseidon-lite/poseidon2'\nconst hash = poseidon2(['0x01', '0x02'])\n```\n\n### Get state elements\n\nMore state elements can be retrieved by passing an optional second argument. Useful for e.g. sponge based encryption. The maximum number of elements that can be retrieved is `input.length + 1`.\n\n```js\nimport { poseidon2 } from 'poseidon-lite'\n\n// retrieve 3 state elements instead of the default 1\nconst elements = poseidon2(['0x01', '0x02'], 3)\n// elements is now a BigInt[3]\n```\n\n## Build\n\n```sh\nnpm i\nnpm run build\nnpm test\n```\n\n## License\n\nVersions `\u003e=0.2.0` are MIT\n\nVersions `\u003c0.2.0` are GPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fposeidon-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchancehudson%2Fposeidon-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fposeidon-lite/lists"}