{"id":17499495,"url":"https://github.com/simonepri/phc-pbkdf2","last_synced_at":"2025-04-28T16:04:30.685Z","repository":{"id":49985091,"uuid":"99381650","full_name":"simonepri/phc-pbkdf2","owner":"simonepri","description":"🔒 Node.JS PBKDF2 password hashing algorithm following the PHC string format. ","archived":false,"fork":false,"pushed_at":"2021-06-07T04:15:19.000Z","size":56,"stargazers_count":12,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T16:04:22.822Z","etag":null,"topics":["hash","hashing","nodejs","password","pbkdf2","secure"],"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:43:45.000Z","updated_at":"2023-11-23T06:05:22.000Z","dependencies_parsed_at":"2022-08-03T15:45:11.018Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/phc-pbkdf2","commit_stats":null,"previous_names":["simonepri/credential-plus-pbkdf2"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-pbkdf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-pbkdf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-pbkdf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-pbkdf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/phc-pbkdf2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342722,"owners_count":21574244,"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":["hash","hashing","nodejs","password","pbkdf2","secure"],"created_at":"2024-10-19T17:13:50.401Z","updated_at":"2025-04-28T16:04:30.644Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003ephc-pbkdf2\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-pbkdf2\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/com/simonepri/phc-pbkdf2/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-pbkdf2\"\u003e\n    \u003cimg src=\"https://img.shields.io/appveyor/ci/simonepri/phc-pbkdf2/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-pbkdf2\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/simonepri/phc-pbkdf2/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-pbkdf2?targetFile=package.json\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/simonepri/phc-pbkdf2/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-pbkdf2\"\u003e\n    \u003cimg src=\"https://david-dm.org/simonepri/phc-pbkdf2/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/pbkdf2\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@phc/pbkdf2.svg\" alt=\"Latest version on npm\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- License - MIT --\u003e\n  \u003ca href=\"https://github.com/simonepri/phc-pbkdf2/tree/master/license\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/simonepri/phc-pbkdf2.svg\" alt=\"Project license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  🔒 Node.JS PBKDF2 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## Synopsis\n\nProtects against brute force, rainbow tables, and timing attacks.\n\nEmploys cryptographically secure, per password salts to prevent rainbow table\nattacks.  \nKey stretching is used to make brute force attacks impractical.  \nA constant time verification check prevents variable response time attacks.\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$pbkdf2-\u003cdigest\u003e$i=\u003citerations\u003e$\u003csalt\u003e$\u003chash\u003e\n```\n\nWhere:\n\n| Field | Type | Description\n| --- | --- | --- |\n| `\u003cdigest\u003e` | \u003ccode\u003estring\u003c/code\u003e | The [HMAC][specs:HMAC] digest algorithm applied to derive a key of the input password. |\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| `\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 [pbkdf2][specs:PBKDF2] algorithm encoded in [B64][specs:B64]. |\n\nFor more details consult the pbkdf2 paper [here][paper].\n\n## Install\n\n```bash\nnpm install --save @phc/pbkdf2\n```\n\n## Usage\n\n```js\nconst pbkdf2 = require('@phc/pbkdf2');\n\n// Hash and verify with pbkdf2 and default configs\nconst hash = await pbkdf2.hash('password');\n// =\u003e $pbkdf2-sha512$i=10000$O484sW7giRw+nt5WVnp15w$jEUMVZ9adB+63ko/8Dr9oB1jWdndpVVQ65xRlT+tA1GTKcJ7BWlTjdaiILzZAhIPEtgTImKvbgnu8TS/ZrjKgA\n\nconst match = await pbkdf2.verify(hash, 'password');\n// =\u003e true\n\nconst match = await pbkdf2.verify(hash, 'wrong');\n// =\u003e false\n\nconst ids = pbkdf2.identifiers();\n// =\u003e ['pbkdf2-sha1', 'pbkdf2-sha256', 'pbkdf2-sha512']\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\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDefault options\u003c/strong\u003e - \u003ci\u003e{iterations:25000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.90 % ± 0.00 %          0.90 % … 0.90 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n22.069 MB ± 0.504 MB     21.357 MB … 22.434 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.045 s         0.098 s        3 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  ----\n0.030 s  0.90 %     21.357 MB  5268\n0.081 s  0.90 %     22.417 MB  5268\n0.098 s  0.90 %     22.434 MB  5268\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e1˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:1000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n1.70 % ± 1.00 %          0.70 % … 2.70 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n23.601 MB ± 0.561 MB     23.040 MB … 24.162 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.010 s         0.06 s         2 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.028 s  0.70 %     23.040 MB  96698\n0.060 s  2.70 %     24.162 MB  96698\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e10˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:10000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\n  CPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n  -----------------------  ---------------------------\n  0.50 % ± 0.00 %          0.50 % … 0.50 %            \n\n  RAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n  -----------------------  ---------------------------\n  23.562 MB ± 0.543 MB     23.020 MB … 24.105 MB      \n\n  Execution time  Sampling time  Samples  \n  --------------  -------------  ---------\n  0.021 s         0.069 s        2 samples\n\n  Instant  CPU Usage  RAM Usage  PIDS\n  -------  ---------  ---------  -----\n  0.027 s  0.50 %     23.020 MB  96709\n  0.069 s  0.50 %     24.105 MB  96709\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e25˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:25000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.90 % ± 0.00 %          0.90 % … 0.90 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n23.966 MB ± 0.516 MB     23.237 MB … 24.330 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.043 s         0.093 s        3 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.027 s  0.90 %     23.237 MB  96720\n0.078 s  0.90 %     24.330 MB  96720\n0.093 s  0.90 %     24.330 MB  96720\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e50˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:50000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n0.90 % ± 0.00 %          0.90 % … 0.90 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.047 MB ± 0.451 MB     23.265 MB … 24.314 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.072 s         0.126 s        4 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.027 s  0.90 %     23.265 MB  96733\n0.075 s  0.90 %     24.293 MB  96733\n0.108 s  0.90 %     24.314 MB  96733\n0.126 s  0.90 %     24.314 MB  96733\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e100˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:100000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n15.65 % ± 17.27 %        0.70 % … 40.00 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.246 MB ± 0.389 MB     23.376 MB … 24.437 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.142 s         0.192 s        6 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.028 s  0.70 %     23.376 MB  96748\n0.079 s  4.40 %     24.416 MB  96748\n0.111 s  4.40 %     24.416 MB  96748\n0.142 s  4.40 %     24.416 MB  96748\n0.168 s  40.00 %    24.416 MB  96748\n0.192 s  40.00 %    24.437 MB  96748\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e250˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:250000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n38.83 % ± 23.16 %        0.60 % … 68.10 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.286 MB ± 0.304 MB     23.192 MB … 24.388 MB      \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.368 s         0.42 s         14 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.028 s  0.60 %     23.192 MB  96767\n0.075 s  0.60 %     24.367 MB  96767\n0.105 s  20.90 %    24.367 MB  96767\n0.136 s  20.90 %    24.367 MB  96767\n0.166 s  20.90 %    24.367 MB  96767\n0.197 s  20.90 %    24.367 MB  96767\n0.229 s  50.90 %    24.367 MB  96767\n0.262 s  50.90 %    24.367 MB  96767\n0.289 s  50.90 %    24.367 MB  96767\n0.319 s  50.90 %    24.367 MB  96767\n0.346 s  50.90 %    24.367 MB  96767\n0.378 s  68.10 %    24.367 MB  96767\n0.404 s  68.10 %    24.388 MB  96767\n0.420 s  68.10 %    24.388 MB  96767\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e500˙000 iterations\u003c/strong\u003e - \u003ci\u003e{iterations:500000, digest:'sha512'}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n61.37 % ± 28.77 %        0.70 % … 91.30 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n24.189 MB ± 0.225 MB     23.044 MB … 24.252 MB      \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.748 s         0.798 s        27 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.027 s  0.70 %     23.044 MB  96802\n0.077 s  13.60 %    24.232 MB  96802\n0.107 s  13.60 %    24.232 MB  96802\n0.139 s  13.60 %    24.232 MB  96802\n0.169 s  13.60 %    24.232 MB  96802\n0.198 s  45.10 %    24.232 MB  96802\n0.229 s  45.10 %    24.232 MB  96802\n0.262 s  45.10 %    24.232 MB  96802\n0.289 s  45.10 %    24.232 MB  96802\n0.313 s  45.10 %    24.232 MB  96802\n0.343 s  65.20 %    24.232 MB  96802\n0.373 s  65.20 %    24.232 MB  96802\n0.404 s  65.20 %    24.232 MB  96802\n0.431 s  65.20 %    24.232 MB  96802\n0.462 s  78.20 %    24.232 MB  96802\n0.491 s  78.20 %    24.232 MB  96802\n0.518 s  78.20 %    24.232 MB  96802\n0.547 s  78.20 %    24.232 MB  96802\n0.578 s  86.60 %    24.232 MB  96802\n0.609 s  86.60 %    24.232 MB  96802\n0.639 s  86.60 %    24.232 MB  96802\n0.668 s  86.60 %    24.232 MB  96802\n0.701 s  91.30 %    24.232 MB  96802\n0.727 s  91.30 %    24.232 MB  96802\n0.756 s  91.30 %    24.232 MB  96802\n0.787 s  91.30 %    24.252 MB  96802\n0.798 s  91.30 %    24.252 MB  96802\n```\n\n\u003c/details\u003e\n\n## Test vectors\n\nThe [pbkdf2 paper][paper:test] lists five test vectors to test implementation.  \nThis package implements them [here][tvec].\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 Node\u0026#39;s\nbuilt-in crypto.randomBytes() and crypto.pbkdf2().\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 Node's\nbuilt-in crypto.randomBytes() and crypto.pbkdf2().\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.iterations] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e25000\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.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| [options.digest] | \u003ccode\u003estring\u003c/code\u003e | \u003ccode\u003e\u0026quot;sha512\u0026quot;\u003c/code\u003e | Optinal name of digest to use when applying the key derivation function. Can be one of [`'sha1'`, `'sha256'`, `'sha512'`]. |\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\nhashing function.  \n**Access**: public\n\n## Related\n- [@phc/argon2][argon2] -\n🔒 Node.JS Argon2 password hashing algorithm following the PHC string format.\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\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-pbkdf2#start-of-content\n[new issue]: https://github.com/simonepri/phc-pbkdf2/issues/new\n[contributors]: https://github.com/simonepri/phc-pbkdf2/contributors\n\n[license]: https://github.com/simonepri/phc-pbkdf2/tree/master/license\n\n[tvec]: https://github.com/simonepri/phc-pbkdf2/tree/master/test/vectors.js\n\n[argon2]: https://github.com/simonepri/phc-argon2\n[scrypt]: https://github.com/simonepri/phc-scrypt\n[bcrypt]: https://github.com/simonepri/phc-bcrypt\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:HMAC]: https://en.wikipedia.org/wiki/HMAC\n[specs:PBKDF2]: https://en.wikipedia.org/wiki/PBKDF2\n\n[paper]: https://tools.ietf.org/html/rfc2898\n[paper:test]: https://tools.ietf.org/html/rfc6070#section-2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-pbkdf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fphc-pbkdf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-pbkdf2/lists"}