{"id":17498330,"url":"https://github.com/simonepri/phc-scrypt","last_synced_at":"2025-04-28T16:11:08.098Z","repository":{"id":49985083,"uuid":"99381762","full_name":"simonepri/phc-scrypt","owner":"simonepri","description":"🔒 Node.JS scrypt password hashing algorithm following the PHC string format.","archived":false,"fork":false,"pushed_at":"2021-06-07T04:16:06.000Z","size":51,"stargazers_count":6,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T16:34:20.379Z","etag":null,"topics":["api","hashing","nodejs","password","scrypt","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:45:31.000Z","updated_at":"2023-06-29T11:09:34.000Z","dependencies_parsed_at":"2022-08-03T15:45:11.537Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/phc-scrypt","commit_stats":null,"previous_names":["simonepri/credential-plus-scrypt"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-scrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-scrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-scrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fphc-scrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/phc-scrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342724,"owners_count":21574245,"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":["api","hashing","nodejs","password","scrypt","secure","unified","universal","upash"],"created_at":"2024-10-19T16:27:59.857Z","updated_at":"2025-04-28T16:11:08.059Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003ephc-scrypt\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-scrypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/com/simonepri/phc-scrypt/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-scrypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/appveyor/ci/simonepri/phc-scrypt/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-scrypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/simonepri/phc-scrypt/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-scrypt?targetFile=package.json\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/simonepri/phc-scrypt/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-scrypt\"\u003e\n    \u003cimg src=\"https://david-dm.org/simonepri/phc-scrypt/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/scrypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@phc/scrypt.svg\" alt=\"Latest version on npm\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- License - MIT --\u003e\n  \u003ca href=\"https://github.com/simonepri/phc-scrypt/tree/master/license\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/simonepri/phc-scrypt.svg\" alt=\"Project license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  🔒 Node.JS scrypt 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$scrypt$ln=\u003ccost\u003e,r=\u003cblocksize\u003e,p=\u003cparallelism\u003e$\u003csalt\u003e$\u003chash\u003e\n```\n\nWhere:\n\n| Field | Type | Description\n| --- | --- | --- |\n| `\u003ccost\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The CPU/Memory cost parameter N encoded as log2(N). |\n| `\u003cblocksize\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The block size parameter r. |\n| `\u003cparallelism\u003e` | \u003ccode\u003enumber\u003c/code\u003e | The parallelization parameter p. |\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 [scrypt][specs:scrypt] algorithm encoded in [B64][specs:B64]. |\n\nFor more details consult the scrypt paper [here][paper].\n\n## Install\n\n```bash\nnpm install --save @phc/scrypt\n```\n\n## Usage\n\n```js\nconst scrypt = require('@phc/scrypt');\n\n// Hash and verify with scrypt and default configs\nconst hash = await scrypt.hash('password');\n// =\u003e $scrypt$ln=15,r=8,p=1$D/EEcdfcBkj4DQB3zlfsFQ$v9Xsag5AySIY78DFKslBzeRXCUfsLKCZ0Xm4Xwoh+J0\n\nconst match = await scrypt.verify(hash, 'password');\n// =\u003e true\n\nconst match = await scrypt.verify(hash, 'wrong');\n// =\u003e false\n\nconst ids = scrypt.identifiers();\n// =\u003e ['scrypt']\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{cost:15, blocksize:8, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n8.30 % ± 3.80 %          0.70 % … 10.20 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n39.765 MB ± 15.420 MB    21.058 MB … 56.001 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.120 s         0.163 s        5 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.024 s  0.70 %     21.058 MB  23332\n0.074 s  10.20 %    43.299 MB  23332\n0.104 s  10.20 %    56.001 MB  23332\n0.135 s  10.20 %    56.001 MB  23332\n0.163 s  10.20 %    22.467 MB  23332\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCost of 10\u003c/strong\u003e - \u003ci\u003e{cost:10, blocksize:8, parallelism:1}\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-----------------------  ---------------------------\n21.713 MB ± 0.602 MB     21.111 MB … 22.315 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.015 s         0.061 s        2 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.025 s  0.60 %     21.111 MB  23349\n0.061 s  0.60 %     22.315 MB  23349\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCost of 14\u003c/strong\u003e - \u003ci\u003e{cost:14, blocksize:8, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n1.00 % ± 0.00 %          1.00 % … 1.00 %            \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n26.058 MB ± 7.145 MB     21.131 MB … 38.404 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.070 s         0.118 s        4 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.024 s  1.00 %     21.131 MB  23360\n0.069 s  1.00 %     38.404 MB  23360\n0.103 s  1.00 %     22.348 MB  23360\n0.118 s  1.00 %     22.348 MB  23360\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCost of 16\u003c/strong\u003e - \u003ci\u003e{cost:16, blocksize:8, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n27.03 % ± 18.50 %        0.60 % … 45.30 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n59.287 MB ± 29.023 MB    20.759 MB … 89.092 MB      \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.248 s         0.293 s        10 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.024 s  0.60 %     20.759 MB  23375\n0.069 s  10.80 %    39.600 MB  23375\n0.100 s  10.80 %    57.696 MB  23375\n0.131 s  10.80 %    74.301 MB  23375\n0.163 s  10.80 %    89.092 MB  23375\n0.194 s  45.30 %    89.092 MB  23375\n0.231 s  45.30 %    89.092 MB  23375\n0.260 s  45.30 %    89.092 MB  23375\n0.291 s  45.30 %    22.073 MB  23375\n0.293 s  45.30 %    22.073 MB  23375\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCost of 18\u003c/strong\u003e - \u003ci\u003e{cost:18, blocksize:8, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n68.16 % ± 28.64 %        0.70 % … 93.90 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n208.153 MB ± 96.535 MB   21.144 MB … 290.943 MB     \n\nExecution time  Sampling time  Samples   \n--------------  -------------  ----------\n0.977 s         1.021 s        34 samples\n\nInstant  CPU Usage  RAM Usage   PIDS\n-------  ---------  ----------  -----\n0.023 s  0.70 %     21.144 MB   23402\n0.071 s  0.70 %     42.115 MB   23402\n0.101 s  0.70 %     59.486 MB   23402\n0.131 s  31.30 %    76.911 MB   23402\n0.162 s  31.30 %    94.630 MB   23402\n0.192 s  31.30 %    112.493 MB  23402\n0.230 s  31.30 %    133.943 MB  23402\n0.262 s  56.80 %    147.997 MB  23402\n0.286 s  56.80 %    160.592 MB  23402\n0.315 s  56.80 %    177.013 MB  23402\n0.346 s  56.80 %    194.724 MB  23402\n0.382 s  72.00 %    210.108 MB  23402\n0.408 s  72.00 %    222.282 MB  23402\n0.431 s  72.00 %    235.143 MB  23402\n0.464 s  72.00 %    252.690 MB  23402\n0.496 s  72.00 %    269.238 MB  23402\n0.529 s  82.00 %    283.013 MB  23402\n0.552 s  82.00 %    290.943 MB  23402\n0.582 s  82.00 %    290.943 MB  23402\n0.615 s  82.00 %    290.943 MB  23402\n0.646 s  87.30 %    290.943 MB  23402\n0.679 s  87.30 %    290.943 MB  23402\n0.707 s  87.30 %    290.943 MB  23402\n0.740 s  87.30 %    290.943 MB  23402\n0.771 s  91.00 %    290.943 MB  23402\n0.796 s  91.00 %    290.943 MB  23402\n0.827 s  91.00 %    290.943 MB  23402\n0.859 s  91.00 %    290.943 MB  23402\n0.896 s  93.50 %    290.943 MB  23402\n0.919 s  93.50 %    290.943 MB  23402\n0.950 s  93.50 %    290.943 MB  23402\n0.983 s  93.50 %    265.421 MB  23402\n1.012 s  93.90 %    22.528 MB   23402\n1.021 s  93.90 %    22.528 MB   23402\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCost of 20\u003c/strong\u003e - \u003ci\u003e{cost:20, blocksize:8, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n91.21 % ± 19.32 %        0.90 % … 100.00 %          \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n804.252 MB ± 357.670 MB  20.914 MB … 1095.913 MB    \n\nExecution time  Sampling time  Samples    \n--------------  -------------  -----------\n3.991 s         4.032 s        132 samples\n\nInstant  CPU Usage  RAM Usage    PIDS\n-------  ---------  -----------  -----\n0.023 s  0.90 %     20.914 MB    23477\n0.073 s  13.70 %    43.454 MB    23477\n0.103 s  13.70 %    61.125 MB    23477\n0.135 s  13.70 %    79.528 MB    23477\n0.166 s  13.70 %    97.137 MB    23477\n0.195 s  46.60 %    113.861 MB   23477\n0.228 s  46.60 %    132.624 MB   23477\n0.257 s  46.60 %    148.546 MB   23477\n0.288 s  46.60 %    166.314 MB   23477\n0.319 s  65.90 %    183.742 MB   23477\n0.350 s  65.90 %    201.548 MB   23477\n0.385 s  65.90 %    218.853 MB   23477\n0.410 s  65.90 %    233.521 MB   23477\n0.445 s  78.10 %    252.256 MB   23477\n0.478 s  78.10 %    268.091 MB   23477\n0.508 s  78.10 %    283.501 MB   23477\n0.532 s  78.10 %    296.665 MB   23477\n0.563 s  78.10 %    314.053 MB   23477\n0.601 s  86.60 %    332.669 MB   23477\n0.630 s  86.60 %    345.465 MB   23477\n0.649 s  86.60 %    356.663 MB   23477\n0.679 s  86.60 %    373.604 MB   23477\n0.706 s  92.20 %    389.239 MB   23477\n0.735 s  92.20 %    406.569 MB   23477\n0.766 s  92.20 %    424.444 MB   23477\n0.796 s  92.20 %    442.057 MB   23477\n0.826 s  92.20 %    459.317 MB   23477\n0.858 s  95.00 %    477.434 MB   23477\n0.886 s  95.00 %    493.470 MB   23477\n0.915 s  95.00 %    509.420 MB   23477\n0.945 s  95.00 %    526.828 MB   23477\n0.976 s  98.00 %    544.375 MB   23477\n1.006 s  98.00 %    561.500 MB   23477\n1.036 s  98.00 %    579.178 MB   23477\n1.068 s  98.00 %    597.348 MB   23477\n1.099 s  99.20 %    614.593 MB   23477\n1.127 s  99.20 %    630.661 MB   23477\n1.165 s  99.20 %    648.651 MB   23477\n1.195 s  99.20 %    663.556 MB   23477\n1.223 s  98.70 %    677.904 MB   23477\n1.250 s  98.70 %    692.257 MB   23477\n1.279 s  98.70 %    708.661 MB   23477\n1.314 s  98.70 %    724.242 MB   23477\n1.346 s  98.80 %    739.234 MB   23477\n1.374 s  98.80 %    753.725 MB   23477\n1.401 s  98.80 %    769.225 MB   23477\n1.433 s  98.80 %    786.985 MB   23477\n1.462 s  98.80 %    804.168 MB   23477\n1.491 s  99.40 %    820.855 MB   23477\n1.522 s  99.40 %    838.889 MB   23477\n1.552 s  99.40 %    856.109 MB   23477\n1.593 s  98.90 %    875.192 MB   23477\n1.612 s  98.90 %    885.109 MB   23477\n1.641 s  98.90 %    901.906 MB   23477\n1.673 s  98.90 %    920.179 MB   23477\n1.706 s  98.90 %    936.202 MB   23477\n1.736 s  99.70 %    950.313 MB   23477\n1.762 s  99.70 %    964.940 MB   23477\n1.793 s  99.70 %    982.942 MB   23477\n1.823 s  99.70 %    1000.940 MB  23477\n1.857 s  99.10 %    1018.970 MB  23477\n1.884 s  99.10 %    1034.842 MB  23477\n1.915 s  99.10 %    1051.058 MB  23477\n1.948 s  99.10 %    1069.253 MB  23477\n2.010 s  99.30 %    1092.149 MB  23477\n2.037 s  99.30 %    1095.913 MB  23477\n2.069 s  99.30 %    1095.913 MB  23477\n2.097 s  97.20 %    1095.913 MB  23477\n2.110 s  97.20 %    1095.913 MB  23477\n2.143 s  97.20 %    1095.913 MB  23477\n2.173 s  97.20 %    1095.913 MB  23477\n2.210 s  97.20 %    1095.913 MB  23477\n2.241 s  99.30 %    1095.913 MB  23477\n2.269 s  99.30 %    1095.913 MB  23477\n2.301 s  99.30 %    1095.913 MB  23477\n2.333 s  99.30 %    1095.913 MB  23477\n2.367 s  98.70 %    1095.913 MB  23477\n2.395 s  98.70 %    1095.913 MB  23477\n2.421 s  98.70 %    1095.913 MB  23477\n2.451 s  98.70 %    1095.913 MB  23477\n2.488 s  98.90 %    1095.913 MB  23477\n2.518 s  98.90 %    1095.913 MB  23477\n2.544 s  98.90 %    1095.913 MB  23477\n2.573 s  98.90 %    1095.913 MB  23477\n2.602 s  98.70 %    1095.913 MB  23477\n2.642 s  98.70 %    1095.913 MB  23477\n2.663 s  98.70 %    1095.913 MB  23477\n2.693 s  98.70 %    1095.913 MB  23477\n2.725 s  98.20 %    1095.913 MB  23477\n2.759 s  98.20 %    1095.913 MB  23477\n2.791 s  98.20 %    1095.913 MB  23477\n2.818 s  98.20 %    1095.913 MB  23477\n2.850 s  97.60 %    1095.913 MB  23477\n2.881 s  97.60 %    1095.913 MB  23477\n2.914 s  97.60 %    1095.913 MB  23477\n2.944 s  97.60 %    1095.913 MB  23477\n2.972 s  97.60 %    1095.913 MB  23477\n3.002 s  97.10 %    1095.913 MB  23477\n3.035 s  97.10 %    1095.913 MB  23477\n3.069 s  97.10 %    1095.913 MB  23477\n3.095 s  97.10 %    1095.913 MB  23477\n3.128 s  100.00 %   1095.913 MB  23477\n3.155 s  100.00 %   1095.913 MB  23477\n3.186 s  100.00 %   1095.913 MB  23477\n3.216 s  100.00 %   1095.913 MB  23477\n3.246 s  98.70 %    1095.913 MB  23477\n3.275 s  98.70 %    1095.913 MB  23477\n3.306 s  98.70 %    1095.913 MB  23477\n3.338 s  98.70 %    1095.913 MB  23477\n3.374 s  98.90 %    1095.913 MB  23477\n3.407 s  98.90 %    1095.913 MB  23477\n3.430 s  98.90 %    1095.913 MB  23477\n3.462 s  98.90 %    1095.913 MB  23477\n3.492 s  98.10 %    1095.913 MB  23477\n3.526 s  98.10 %    1095.913 MB  23477\n3.555 s  98.10 %    1095.913 MB  23477\n3.581 s  98.10 %    1095.913 MB  23477\n3.612 s  99.00 %    1095.913 MB  23477\n3.645 s  99.00 %    1095.913 MB  23477\n3.678 s  99.00 %    1095.913 MB  23477\n3.714 s  99.00 %    1095.913 MB  23477\n3.739 s  97.90 %    1095.913 MB  23477\n3.770 s  97.90 %    1095.913 MB  23477\n3.809 s  97.90 %    1095.913 MB  23477\n3.835 s  97.90 %    1095.913 MB  23477\n3.861 s  97.80 %    1095.913 MB  23477\n3.890 s  97.80 %    1095.913 MB  23477\n3.937 s  97.80 %    927.875 MB   23477\n3.967 s  97.80 %    559.043 MB   23477\n3.985 s  97.90 %    334.381 MB   23477\n4.015 s  97.90 %    22.172 MB    23477\n4.032 s  97.90 %    22.192 MB    23477\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBlocksize of 9\u003c/strong\u003e - \u003ci\u003e{cost:15, blocksize:9, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n14.20 % ± 9.62 %         0.60 % … 21.00 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n37.687 MB ± 17.146 MB    20.775 MB … 59.740 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.137 s         0.183 s        6 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.024 s  0.60 %     20.775 MB  23748\n0.072 s  0.60 %     41.751 MB  23748\n0.104 s  21.00 %    59.740 MB  23748\n0.136 s  21.00 %    59.740 MB  23748\n0.169 s  21.00 %    22.057 MB  23748\n0.183 s  21.00 %    22.057 MB  23748\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBlocksize of 10\u003c/strong\u003e - \u003ci\u003e{cost:15, blocksize:10, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n16.46 % ± 16.87 %        0.60 % … 42.90 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n41.805 MB ± 18.883 MB    20.660 MB … 64.053 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.149 s         0.2 s          7 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.024 s  0.60 %     20.660 MB  23767\n0.072 s  7.20 %     40.935 MB  23767\n0.103 s  7.20 %     58.663 MB  23767\n0.133 s  7.20 %     64.053 MB  23767\n0.164 s  7.20 %     64.053 MB  23767\n0.198 s  42.90 %    22.135 MB  23767\n0.200 s  42.90 %    22.135 MB  23767\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBlocksize of 11\u003c/strong\u003e - \u003ci\u003e{cost:15, blocksize:11, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n18.80 % ± 15.24 %        1.20 % … 32.00 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n43.562 MB ± 20.569 MB    20.746 MB … 68.104 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.160 s         0.206 s        7 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.023 s  1.20 %     20.746 MB  23788\n0.072 s  1.20 %     42.975 MB  23788\n0.103 s  1.20 %     61.026 MB  23788\n0.134 s  32.00 %    68.104 MB  23788\n0.164 s  32.00 %    68.104 MB  23788\n0.198 s  32.00 %    21.987 MB  23788\n0.206 s  32.00 %    21.987 MB  23788\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBlocksize of 12\u003c/strong\u003e - \u003ci\u003e{cost:15, blocksize:12, parallelism:1}\u003c/i\u003e ↴\u003c/summary\u003e\n\n```\nCPU Usage (avarage ± σ)  CPU Usage Range (min … max)\n-----------------------  ---------------------------\n22.75 % ± 16.29 %        0.60 % … 46.60 %           \n\nRAM Usage (avarage ± σ)  RAM Usage Range (min … max)\n-----------------------  ---------------------------\n47.866 MB ± 22.444 MB    21.070 MB … 72.593 MB      \n\nExecution time  Sampling time  Samples  \n--------------  -------------  ---------\n0.180 s         0.234 s        8 samples\n\nInstant  CPU Usage  RAM Usage  PIDS\n-------  ---------  ---------  -----\n0.025 s  0.60 %     21.070 MB  23809\n0.072 s  0.60 %     40.772 MB  23809\n0.103 s  21.90 %    58.741 MB  23809\n0.135 s  21.90 %    72.593 MB  23809\n0.164 s  21.90 %    72.593 MB  23809\n0.195 s  21.90 %    72.593 MB  23809\n0.232 s  46.60 %    22.282 MB  23809\n0.234 s  46.60 %    22.282 MB  23809\n```\n\n\u003c/details\u003e\n\n## Test vectors\n\nThe [scrypt paper][paper:test] lists four 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 scrypt\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 scrypt\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.blocksize] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e8\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.cost] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e15\u003c/code\u003e | Optional CPU/memory cost parameter. Must be an integer power of 2 within the range (`2` \u003c= `cost` \u003c= `2^((128 * blocksize) / 8) - 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^32-1) * 32) / (128 * blocksize)`). |\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/argon2][argon2] -\n🔒 Node.JS Argon2 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-scrypt#start-of-content\n[new issue]: https://github.com/simonepri/phc-scrypt/issues/new\n[contributors]: https://github.com/simonepri/phc-scrypt/contributors\n\n[license]: https://github.com/simonepri/phc-scrypt/tree/master/license\n\n[tvec]: https://github.com/simonepri/phc-scrypt/tree/master/test/vectors.js\n\n[argon2]: https://github.com/simonepri/phc-argon2\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:scrypt]: https://en.wikipedia.org/wiki/scrypt\n\n[paper]: https://tools.ietf.org/html/rfc7914\n[paper:test]: https://tools.ietf.org/html/rfc7914#section-12\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-scrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fphc-scrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fphc-scrypt/lists"}