{"id":13484110,"url":"https://github.com/ranisalt/node-argon2","last_synced_at":"2026-04-09T18:39:43.128Z","repository":{"id":38421146,"uuid":"48276775","full_name":"ranisalt/node-argon2","owner":"ranisalt","description":"Node.js bindings for Argon2 hashing algorithm","archived":false,"fork":false,"pushed_at":"2025-04-24T11:37:31.000Z","size":1585,"stargazers_count":1985,"open_issues_count":5,"forks_count":97,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-14T22:05:29.443Z","etag":null,"topics":["argon2","crypto","encryption","hacktoberfest","hashing","nodejs","password"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/argon2","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ranisalt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":"node-argon2","ko_fi":"ranieri","tidelift":null,"community_bridge":null,"liberapay":"ranieri","issuehunt":"ranisalt/node-argon2","otechie":null,"custom":null}},"created_at":"2015-12-19T09:50:48.000Z","updated_at":"2025-05-14T13:49:48.000Z","dependencies_parsed_at":"2023-11-18T03:49:48.004Z","dependency_job_id":"2b834b2b-fca1-486c-b60c-3612fa84689a","html_url":"https://github.com/ranisalt/node-argon2","commit_stats":{"total_commits":688,"total_committers":47,"mean_commits":"14.638297872340425","dds":"0.21802325581395354","last_synced_commit":"853a021a971cb9a531f0fda28ddad266a00d989e"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranisalt%2Fnode-argon2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranisalt%2Fnode-argon2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranisalt%2Fnode-argon2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranisalt%2Fnode-argon2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ranisalt","download_url":"https://codeload.github.com/ranisalt/node-argon2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235687,"owners_count":22036962,"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":["argon2","crypto","encryption","hacktoberfest","hashing","nodejs","password"],"created_at":"2024-07-31T17:01:19.528Z","updated_at":"2026-04-09T18:39:43.029Z","avatar_url":"https://github.com/ranisalt.png","language":"JavaScript","readme":"# node-argon2\n\n[![Financial contributors on Open Collective][opencollective-image]][opencollective-url]\n[![Build status][actions-image]][actions-url]\n[![NPM package][npm-image]][npm-url]\n\nBindings to the reference [Argon2](https://github.com/P-H-C/phc-winner-argon2)\nimplementation.\n\n## Usage\nIt's possible to hash using either Argon2i, Argon2d or Argon2id (default), and\nverify if a password matches a hash.\n\nTo hash a password:\n```js\nconst argon2 = require('argon2');\n\ntry {\n  const hash = await argon2.hash(\"password\");\n} catch (err) {\n  //...\n}\n```\n\nTo see how you can modify the output (hash length, encoding) and parameters\n(time cost, memory cost and parallelism),\n[read the wiki](https://github.com/ranisalt/node-argon2/wiki/Options)\n\nTo verify a password:\n```js\ntry {\n  if (await argon2.verify(\"\u003cbig long hash\u003e\", \"password\")) {\n    // password match\n  } else {\n    // password did not match\n  }\n} catch (err) {\n  // internal failure\n}\n```\n\n### Migrating from another hash function\nSee [this article on the wiki](https://github.com/ranisalt/node-argon2/wiki/Migrating-from-another-hash-function) for steps on how to migrate your existing code to Argon2. It's easy!\n\n### TypeScript usage\nA TypeScript type declaration file is published with this module. If you are\nusing TypeScript 2.0.0 or later, that means you do not need to install any\nadditional typings in order to get access to the strongly typed interface.\nSimply use the library as mentioned above.\n\n```ts\nimport * as argon2 from \"argon2\";\n\nconst hash = await argon2.hash(..);\n```\n\n## Prebuilt binaries\n**node-argon2** provides prebuilt binaries from `v0.26.0` onwards. They are\nbuilt every release using GitHub Actions.\n\nThe current prebuilt binaries are built and tested with the following systems:\n- Ubuntu 20.04 (x86-64; ARM64 from v0.28.2; ARMv7 from v0.43.0)\n- MacOS 13 (x86-64)\n- MacOS 14 (ARM64 from v0.29.0)\n- Windows Server 2019 (x86-64)\n- Alpine Linux 3.18 (x86-64 from v0.28.1; ARM64 from v0.28.2; ARMv7 from v0.43.0)\n- FreeBSD 14 (x86-64 from v0.29.1)\n\nBinaries should also work for any version more recent than the ones listed\nabove. For example, the binary for Ubuntu 20.04 also works on Ubuntu 22.04, or\nany other Linux system that ships a newer version of glibc; the binary for\nMacOS 11 also works on MacOS 12. If your platform is below the above\nrequirements, you can follow the [Before installing](#before-installing)\nsection below to manually compile from source. It is also always recommended to\nbuild from source to ensure consistency of the compiled module.\n\n## Before installing\n*You can skip this section if the [prebuilt binaries](#prebuilt-binaries) work for you.*\n\nYou **MUST** have a **node-gyp** global install before proceeding with the install,\nalong with GCC \u003e= 5 / Clang \u003e= 3.3. On Windows, you must compile under Visual\nStudio 2015 or newer.\n\n**node-argon2** works only and is tested against Node \u003e=18.0.0.\n\n### OSX\nTo install GCC \u003e= 5 on OSX, use [homebrew](http://brew.sh/):\n```console\n$ brew install gcc\n```\n\nOnce you've got GCC installed and ready to run, you then need to install\nnode-gyp, you must do this globally:\n```console\n$ npm install -g node-gyp\n```\n\nFinally, once node-gyp is installed and ready to go, you can install this\nlibrary, specifying the GCC or Clang binary to use:\n\n```console\n$ CXX=g++-12 npm install argon2\n```\n\n**NOTE**: If your GCC or Clang binary is named something different than `g++-12`,\nyou'll need to specify that in the command.\n\n## FAQ\n\u003cdetails\u003e\n  \u003csummary\u003eHow do I manually rebuild the binaries?\u003c/summary\u003e\n\n  ```bash\n  $ npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2\n  ```\n\n  Run `@mapbox/node-pre-gyp` instead of `node-gyp` because node-argon2's\n  `binding.gyp` file relies on variables from `@mapbox/node-pre-gyp`.\n\n  You can omit `npx @mapbox` and use just `node-pre-gyp` if you have a global\n  installation of `@mapbox/node-pre-gyp`, otherwise prefixing `npx` will use\n  the local one in `./node_modules/.bin`\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    How do I skip installing prebuilt binaries and manually compile from source?\n  \u003c/summary\u003e\n\n  You can do either of the two methods below:\n\n  1. Force build from source on install.\n  ```bash\n  $ npm install argon2 --build-from-source\n  ```\n\n  2. Ignore `node-argon2` install script and build manually.\n  ```bash\n  $ npm install argon2 --ignore-scripts\n  $ npx node-gyp rebuild -C ./node_modules/argon2\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    I installed Node as a \u003ca href=\"https://snapcraft.io/node\"\u003esnap\u003c/a\u003e, and I can't install node-argon2.\n  \u003c/summary\u003e\n\n  This seems to be an issue related to snap (see [#345 (comment)](https://github.com/ranisalt/node-argon2/issues/345#issuecomment-1164178674)). Installing Node with another package manager, such as [asdf](https://asdf-vm.com/) or [nvm](https://github.com/nvm-sh/nvm), is a possible workaround.\n\u003c/details\u003e\n\n## Contributors\n\n### Code contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/ranisalt/node-argon2/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/node-argon2/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/node-argon2\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/node-argon2/contribute)]\n\n\u003ca href=\"https://opencollective.com/node-argon2/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/node-argon2/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/node-argon2/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n\n## License\nWork licensed under the [MIT License](LICENSE). Please check\n[P-H-C/phc-winner-argon2](https://github.com/P-H-C/phc-winner-argon2) for\nlicense over Argon2 and the reference implementation.\n\n[opencollective-image]: https://img.shields.io/opencollective/all/node-argon2.svg?style=flat-square\n[opencollective-url]: https://opencollective.com/node-argon2\n[npm-image]: https://img.shields.io/npm/v/argon2.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/argon2\n[actions-image]: https://img.shields.io/github/actions/workflow/status/ranisalt/node-argon2/ci.yml?branch=master\u0026style=flat-square\n[actions-url]: https://github.com/ranisalt/node-argon2/actions\n","funding_links":["https://opencollective.com/node-argon2","https://ko-fi.com/ranieri","https://liberapay.com/ranieri","https://issuehunt.io/r/ranisalt/node-argon2","https://opencollective.com/node-argon2/contribute","https://opencollective.com/node-argon2/organization/0/website","https://opencollective.com/node-argon2/organization/1/website","https://opencollective.com/node-argon2/organization/2/website","https://opencollective.com/node-argon2/organization/3/website","https://opencollective.com/node-argon2/organization/4/website","https://opencollective.com/node-argon2/organization/5/website","https://opencollective.com/node-argon2/organization/6/website","https://opencollective.com/node-argon2/organization/7/website","https://opencollective.com/node-argon2/organization/8/website","https://opencollective.com/node-argon2/organization/9/website"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franisalt%2Fnode-argon2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Franisalt%2Fnode-argon2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franisalt%2Fnode-argon2/lists"}