{"id":13464874,"url":"https://github.com/simonepri/phc-argon2","last_synced_at":"2025-07-23T09:05:25.317Z","repository":{"id":49881675,"uuid":"99381790","full_name":"simonepri/phc-argon2","owner":"simonepri","description":"🔒 Node.JS Argon2 password hashing algorithm following the PHC string format. ","archived":false,"fork":false,"pushed_at":"2022-11-10T05:38:49.000Z","size":54,"stargazers_count":17,"open_issues_count":12,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T13:31:39.782Z","etag":null,"topics":["api","argon2","hashing","nodejs","password","secure","unified","universal","upash"],"latest_commit_sha":null,"homepage":"","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/simonepri.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-04T21:46:03.000Z","updated_at":"2023-02-13T18:43:51.000Z","dependencies_parsed_at":"2023-01-21T20:46:39.558Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/phc-argon2","commit_stats":null,"previous_names":["simonepri/credential-plus-argon2"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/simonepri/phc-argon2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-argon2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-argon2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-argon2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-argon2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/phc-argon2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-argon2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266649137,"owners_count":23962174,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","argon2","hashing","nodejs","password","secure","unified","universal","upash"],"created_at":"2024-07-31T14:00:52.017Z","updated_at":"2025-07-23T09:05:25.271Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003ephc-argon2\u003c/b\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!-- CI - TravisCI --\u003e\n  \u003ca href=\"https://travis-ci.com/simonepri/phc-argon2\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/com/simonepri/phc-argon2/master.svg?label=MacOS%20%26%20Linux\" alt=\"Mac/Linux Build Status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- CI - AppVeyor --\u003e\n  \u003ca href=\"https://ci.appveyor.com/project/simonepri/phc-argon2\"\u003e\n    \u003cimg src=\"https://img.shields.io/appveyor/ci/simonepri/phc-argon2/master.svg?label=Windows\" alt=\"Windows Build status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Coverage - Codecov --\u003e\n  \u003ca href=\"https://codecov.io/gh/simonepri/phc-argon2\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/simonepri/phc-argon2/master.svg\" alt=\"Codecov Coverage report\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- DM - Snyk --\u003e\n  \u003ca href=\"https://snyk.io/test/github/simonepri/phc-argon2?targetFile=package.json\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/simonepri/phc-argon2/badge.svg?targetFile=package.json\" alt=\"Known Vulnerabilities\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- DM - David --\u003e\n  \u003ca href=\"https://david-dm.org/simonepri/phc-argon2\"\u003e\n    \u003cimg src=\"https://david-dm.org/simonepri/phc-argon2/status.svg\" alt=\"Dependency Status\" /\u003e\n  \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003c!-- Code Style - XO-Prettier --\u003e\n  \u003ca href=\"https://github.com/xojs/xo\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code_style-XO+Prettier-5ed9c7.svg\" alt=\"XO Code Style used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Test Runner - AVA --\u003e\n  \u003ca href=\"https://github.com/avajs/ava\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/test_runner-AVA-fb3170.svg\" alt=\"AVA Test Runner used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Test Coverage - Istanbul --\u003e\n  \u003ca href=\"https://github.com/istanbuljs/nyc\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/test_coverage-NYC-fec606.svg\" alt=\"Istanbul Test Coverage used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Init - ni --\u003e\n  \u003ca href=\"https://github.com/simonepri/ni\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/initialized_with-ni-e74c3c.svg\" alt=\"NI Scaffolding System used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Release - np --\u003e\n  \u003ca href=\"https://github.com/sindresorhus/np\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/released_with-np-6c8784.svg\" alt=\"NP Release System used\" /\u003e\n  \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003c!-- Version - npm --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@phc/argon2\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@phc/argon2.svg\" alt=\"Latest version on npm\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- License - MIT --\u003e\n  \u003ca href=\"https://github.com/simonepri/phc-argon2/tree/master/license\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/simonepri/phc-argon2.svg\" alt=\"Project license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  🔒 Node.JS Argon2 password hashing algorithm following the PHC string format.\n  \u003cbr/\u003e\n\n  \u003csub\u003e\n    Coded with ❤️ by \u003ca href=\"#authors\"\u003eSimone Primarosa\u003c/a\u003e.\n  \u003c/sub\u003e\n\u003c/p\u003e\n\n## PHC String Format\n\nThe [PHC String Format][specs:phc] is an attempt to specify a common hash string format that’s a restricted \u0026 well defined subset of the Modular Crypt Format. New hashes are strongly encouraged to adhere to the PHC specification, rather than the much looser [Modular Crypt Format][specs:mcf].\n\nThe hash strings generated by this package are in the following format:\n\n```c\n$argon2\u003cvariant\u003e$v=\u003cversion\u003e$m=\u003cmemory\u003e,t=\u003citerations\u003e,p=\u003cparallelism\u003e$\u003csalt\u003e$\u003chash\u003e\n```\n\nWhere:\n\n| Field | Type | Description\n| --- | --- | --- |\n| `\u003cvariant\u003e` | \u003ccode\u003estring\u003c/code\u003e | The [variant][specs:a2var] of the algorithm used to derive a key of the input password. |\n| `\u003cversion\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The version of the argon2 algorithm used. |\n| `\u003cmemory\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The amount of memory to consume in kibibytes. |\n| `\u003citerations\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The number of iterations desired. The higher the number of iterations, the more secure the derived key will be, but will take a longer amount of time to complete. |\n| `\u003cparallelism\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The degree of parallelism to use while computing the hash. |\n| `\u003csalt\u003e` | \u003ccode\u003estring\u003c/code\u003e | A sequence of bits, known as a [cryptographic salt][specs:salt] encoded in [B64][specs:B64]. |\n| `\u003chash\u003e` | \u003ccode\u003estring\u003c/code\u003e | The computed derived key by the [argon2][specs:Argon2] algorithm encoded in [B64][specs:B64]. |\n\nFor more details consult the Argon2 paper [here][paper].\n\n## Install\n\n```bash\nnpm install --save @phc/argon2\n```\n\n## Usage\n\n```js\nconst argon2 = require('@phc/argon2');\n\n// Hash and verify with argon2 and default configs\nconst hash = await argon2.hash('password');\n// =\u003e $argon2id$v=19$m=4096,t=3,p=1$PcEZHj1maR/+ZQynyJHWZg$2jEN4xcww7CYp1jakZB1rxbYsZ55XH2HgjYRtdZtubI\n\nconst match = await argon2.verify(hash, 'password');\n// =\u003e true\n\nconst match = await argon2.verify(hash, 'wrong');\n// =\u003e false\n\nconst ids = argon2.identifiers();\n// =\u003e ['argon2d', 'argon2i', 'argon2id']\n```\n\n## Benchmarks\n\nBelow you can find usage statistics of this hashing algorithm with different\noptions.  \nThis should help you understand how the different options affects the running\ntime and memory usage of the algorithm.\n\nUsage reports are generated thanks to [sympact][gh:sympact].\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eSystem Report\u003c/strong\u003e ↴\u003c/summary\u003e\n\n```\nDistro    Release  Platform  Arch\n--------  -------  --------  ----\nMac OS X  10.12.6  darwin    x64\n\nCPU     Brand           Clock     Cores\n------  --------------  --------  -----\nIntel®  Core™ i5-6360U  2.00 GHz  4    \n\nMemory                  Type    Size         Clock   \n----------------------  ------  -----------  --------\nMicron Technology Inc.  LPDDR3  4294.967 MB  1867 MHz\nMicron Technology Inc.  LPDDR3  4294.967 MB  1867 MHz\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDefault options\u003c/strong\u003e - \u003ci\u003e{iterations:3, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.50 % ± 0.00 %          0.50 % … 0.50 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n23.927 MB ± 2.775 MB     21.152 MB … 26.702 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.020 s         0.069 s        2 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.028 s  0.50 %     21.152 MB  4934\n0.069 s  0.50 %     26.702 MB  4934\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e5 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:5, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.60 % ± 0.00 %          0.60 % … 0.60 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.906 MB ± 2.591 MB     21.242 MB … 26.739 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.025 s         0.077 s        3 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.025 s  0.60 %     21.242 MB  4945\n0.076 s  0.60 %     26.739 MB  4945\n0.077 s  0.60 %     26.739 MB  4945\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e10 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:10, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.40 % ± 0.00 %          0.40 % … 0.40 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.999 MB ± 2.576 MB     21.357 MB … 26.821 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.054 s         0.112 s        3 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.033 s  0.40 %     21.357 MB  4958\n0.094 s  0.40 %     26.821 MB  4958\n0.112 s  0.40 %     26.821 MB  4958\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e25 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:25, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n6.78 % ± 10.70 %         0.60 % … 25.30 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n25.440 MB ± 2.365 MB     21.344 MB … 26.817 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.082 s         0.129 s        4 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.026 s  0.60 %     21.344 MB  4971\n0.077 s  0.60 %     26.800 MB  4971\n0.109 s  0.60 %     26.800 MB  4971\n0.129 s  25.30 %    26.817 MB  4971\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e50 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:50, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n12.24 % ± 7.36 %         0.60 % … 16.90 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n26.076 MB ± 1.907 MB     21.406 MB … 26.866 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.158 s         0.207 s        7 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.026 s  0.60 %     21.406 MB  4986\n0.077 s  0.60 %     26.849 MB  4986\n0.107 s  16.90 %    26.849 MB  4986\n0.145 s  16.90 %    26.849 MB  4986\n0.167 s  16.90 %    26.849 MB  4986\n0.196 s  16.90 %    26.866 MB  4986\n0.207 s  16.90 %    26.866 MB  4986\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e100 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:100, memory:4096, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n37.25 % ± 22.39 %        1.10 % … 59.20 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n26.418 MB ± 1.453 MB     21.385 MB … 26.849 MB      \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.408 s         0.479 s        13 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.026 s  1.10 %     21.385 MB  5007\n0.076 s  1.10 %     26.833 MB  5007\n0.106 s  1.10 %     26.833 MB  5007\n0.153 s  30.70 %    26.833 MB  5007\n0.170 s  30.70 %    26.833 MB  5007\n0.201 s  30.70 %    26.833 MB  5007\n0.301 s  50.70 %    26.833 MB  5007\n0.330 s  50.70 %    26.833 MB  5007\n0.366 s  50.70 %    26.833 MB  5007\n0.403 s  59.20 %    26.833 MB  5007\n0.453 s  59.20 %    26.849 MB  5007\n0.478 s  59.20 %    26.849 MB  5007\n0.479 s  59.20 %    26.849 MB  5007\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e16˙384 KiB of memory\u003c/strong\u003e - \u003ci\u003e{iterations:3, memory:16384, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n5.58 % ± 2.81 %          0.70 % … 7.20 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n34.916 MB ± 7.812 MB     21.385 MB … 39.432 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.071 s         0.13 s         4 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.033 s  0.70 %     21.385 MB  5040\n0.083 s  7.20 %     39.416 MB  5040\n0.116 s  7.20 %     39.432 MB  5040\n0.130 s  7.20 %     39.432 MB  5040\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e65˙536 KiB of memory\u003c/strong\u003e - \u003ci\u003e{iterations:3, memory:65536, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n21.92 % ± 17.48 %        0.60 % … 49.30 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n75.683 MB ± 23.350 MB    20.980 MB … 89.358 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.205 s         0.258 s        8 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.025 s  0.60 %     20.980 MB  5055\n0.075 s  0.60 %     55.775 MB  5055\n0.106 s  18.90 %    81.981 MB  5055\n0.143 s  18.90 %    89.342 MB  5055\n0.164 s  18.90 %    89.342 MB  5055\n0.194 s  18.90 %    89.342 MB  5055\n0.225 s  49.30 %    89.342 MB  5055\n0.258 s  49.30 %    89.358 MB  5055\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e262˙144 KiB of memory\u003c/strong\u003e - \u003ci\u003e{iterations:3, memory:262144, parallelism:1, variant:'id'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n64.37 % ± 28.91 %        0.60 % … 93.90 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n216.095 MB ± 96.874 MB   21.332 MB … 291.025 MB     \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.885 s         0.933 s        31 samples\n\nInstant  CPU Usage  RAM Usage   PIDS\n-------  ---------  ----------  ----\n0.026 s  0.60 %     21.332 MB   5078\n0.074 s  0.60 %     51.356 MB   5078\n0.106 s  19.40 %    77.545 MB   5078\n0.136 s  19.40 %    99.344 MB   5078\n0.167 s  19.40 %    121.168 MB  5078\n0.192 s  19.40 %    140.993 MB  5078\n0.225 s  47.90 %    165.065 MB  5078\n0.260 s  47.90 %    188.371 MB  5078\n0.286 s  47.90 %    205.804 MB  5078\n0.315 s  47.90 %    229.233 MB  5078\n0.343 s  66.20 %    252.084 MB  5078\n0.404 s  66.20 %    288.231 MB  5078\n0.422 s  66.20 %    291.025 MB  5078\n0.439 s  66.20 %    291.025 MB  5078\n0.468 s  77.00 %    291.025 MB  5078\n0.498 s  77.00 %    291.025 MB  5078\n0.528 s  77.00 %    291.025 MB  5078\n0.554 s  77.00 %    291.025 MB  5078\n0.586 s  77.00 %    291.025 MB  5078\n0.619 s  85.10 %    291.025 MB  5078\n0.649 s  85.10 %    291.025 MB  5078\n0.672 s  85.10 %    291.025 MB  5078\n0.703 s  85.10 %    291.025 MB  5078\n0.735 s  89.80 %    291.025 MB  5078\n0.765 s  89.80 %    291.025 MB  5078\n0.792 s  89.80 %    291.025 MB  5078\n0.823 s  89.80 %    291.025 MB  5078\n0.854 s  93.90 %    291.025 MB  5078\n0.896 s  93.90 %    156.807 MB  5078\n0.918 s  93.90 %    22.606 MB   5078\n0.933 s  93.90 %    22.606 MB   5078\n```\n\n\u003c/details\u003e\n\n\u003c!--\n## Test vectors\n\nThe [scrypt paper][paper:test] lists four test vectors to test implementation.  \nThis package implements them [here][tvec].\n--\u003e\n\n## API\n\n#### TOC\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#hash\"\u003ehash(password, [options])\u003c/a\u003e ⇒ \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eComputes the hash string of the given password in the PHC format using argon2\npackage.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#verify\"\u003everify(phcstr, password)\u003c/a\u003e ⇒ \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eDetermines whether or not the hash stored inside the PHC formatted string\nmatches the hash generated for the password provided.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#identifiers\"\u003eidentifiers()\u003c/a\u003e ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eGets the list of all identifiers supported by this hashing function.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"hash\"\u003e\u003c/a\u003e\n\n### hash(password, [options]) ⇒ \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e\nComputes the hash string of the given password in the PHC format using argon2\npackage.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e - The generated secure hash string in the PHC\nformat.  \n**Access**: public  \n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| password | \u003ccode\u003estring\u003c/code\u003e |  | The password to hash. |\n| [options] | \u003ccode\u003eObject\u003c/code\u003e |  | Optional configurations related to the hashing function. |\n| [options.variant] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003eid\u003c/code\u003e | Optinal variant of argon2 to use. Can be one of [`'d'`, `'i'`, `'id'`] for argon2d, argon2i and argon2id respectively. |\n| [options.iterations] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e3\u003c/code\u003e | Optional number of iterations to use. Must be an integer within the range (`1` \u003c= `iterations` \u003c= `2^32-1`). |\n| [options.memory] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e4096\u003c/code\u003e | Optional amount of memory to use in kibibytes. Must be an integer within the range (`8` \u003c= `memory` \u003c= `2^32-1`). |\n| [options.parallelism] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1\u003c/code\u003e | Optional degree of parallelism to use. Must be an integer within the range (`1` \u003c= `parallelism` \u003c= `2^24-1`). |\n| [options.saltSize] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e16\u003c/code\u003e | Optional number of bytes to use when autogenerating new salts. Must be an integer within the range (`1` \u003c= `saltSize` \u003c= `2^10-1`). |\n\n\u003ca name=\"verify\"\u003e\u003c/a\u003e\n\n### verify(phcstr, password) ⇒ \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e\nDetermines whether or not the hash stored inside the PHC formatted string\nmatches the hash generated for the password provided.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e - A boolean that is true if the hash computed\nfor the password matches.  \n**Access**: public  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| phcstr | \u003ccode\u003estring\u003c/code\u003e | Secure hash string generated from this package. |\n| password | \u003ccode\u003estring\u003c/code\u003e | User's password input. |\n\n\u003ca name=\"identifiers\"\u003e\u003c/a\u003e\n\n### identifiers() ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\nGets the list of all identifiers supported by this hashing function.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e - A list of identifiers supported by this hashing function.  \n**Access**: public  \n\n## Related\n- [@phc/scrypt][scrypt] -\n🔒 Node.JS scrypt password hashing algorithm following the PHC string format.\n- [@phc/bcrypt][bcrypt] -\n🔒 Node.JS bcrypt password hashing algorithm following the PHC string format.\n- [@phc/pbkdf2][pbkdf2] -\n🔒 Node.JS PBKDF2 password hashing algorithm following the PHC string format.\n\n## Contributing\n\nContributions are REALLY welcome and if you find a security flaw in this code, PLEASE [report it][new issue].  \n\n## Authors\n\n- **Simone Primarosa** - *Github* ([@simonepri][github:simonepri]) • *Twitter* ([@simoneprimarosa][twitter:simoneprimarosa])\n\nSee also the list of [contributors][contributors] who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [license][license] file for details.\n\n\u003c!-- Links --\u003e\n[start]: https://github.com/simonepri/phc-argon2#start-of-content\n[new issue]: https://github.com/simonepri/phc-argon2/issues/new\n[contributors]: https://github.com/simonepri/phc-argon2/contributors\n\n[license]: https://github.com/simonepri/phc-argon2/tree/master/license\n\n[tvec]: https://github.com/simonepri/phc-argon2/tree/master/test/vectors.js\n\n[scrypt]: https://github.com/simonepri/phc-scrypt\n[bcrypt]: https://github.com/simonepri/phc-bcrypt\n[pbkdf2]: https://github.com/simonepri/phc-pbkdf2\n\n[github:simonepri]: https://github.com/simonepri\n[twitter:simoneprimarosa]: http://twitter.com/intent/user?screen_name=simoneprimarosa\n\n[gh:sympact]: https://github.com/simonepri/sympact\n\n[specs:mcf]: https://github.com/ademarre/binary-mcf\n[specs:phc]: https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md\n[specs:B64]: https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#b64\n[specs:salt]: https://en.wikipedia.org/wiki/Salt_(cryptography)\n[specs:a2var]: https://crypto.stackexchange.com/a/49969\n[specs:Argon2]: https://en.wikipedia.org/wiki/Argon2\n\n[paper]: https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03\n[paper:test]: https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-6\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-argon2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fphc-argon2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-argon2/lists"}