{"id":16834997,"url":"https://github.com/dchest/scrypt-async-js","last_synced_at":"2025-04-05T02:09:08.506Z","repository":{"id":14986379,"uuid":"17711596","full_name":"dchest/scrypt-async-js","owner":"dchest","description":"Fast \"async\" scrypt implementation in JavaScript","archived":false,"fork":false,"pushed_at":"2018-09-08T21:41:03.000Z","size":189,"stargazers_count":139,"open_issues_count":2,"forks_count":26,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-14T13:11:38.703Z","etag":null,"topics":["cperciva","crypto","javascript","kdf","pbkdf2","scrypt"],"latest_commit_sha":null,"homepage":"http://dchest.github.io/scrypt-async-js/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dchest.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":"2014-03-13T13:51:14.000Z","updated_at":"2024-01-31T21:04:14.000Z","dependencies_parsed_at":"2022-08-20T11:01:15.937Z","dependency_job_id":null,"html_url":"https://github.com/dchest/scrypt-async-js","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fscrypt-async-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fscrypt-async-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fscrypt-async-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fscrypt-async-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchest","download_url":"https://codeload.github.com/dchest/scrypt-async-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276164,"owners_count":20912288,"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":["cperciva","crypto","javascript","kdf","pbkdf2","scrypt"],"created_at":"2024-10-13T12:08:38.061Z","updated_at":"2025-04-05T02:09:08.486Z","avatar_url":"https://github.com/dchest.png","language":"JavaScript","readme":"scrypt-async\n============\n\n[![Build Status](https://travis-ci.org/dchest/scrypt-async-js.svg?branch=master)](https://travis-ci.org/dchest/scrypt-async-js)\n[![Coverage Status](https://coveralls.io/repos/dchest/scrypt-async-js/badge.svg)](https://coveralls.io/r/dchest/scrypt-async-js)\n\n[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/scrypt.svg)](https://saucelabs.com/u/scrypt)\n\nFast \"async\" scrypt implementation in JavaScript.\n\nWorks in browsers without throwing \"kill slow script\" warnings due to\nconfigurable interruptStep, which yields from calculation. Compatible even with\nold versions of IE. Also works with Node.js (but you should really use the C\nimplementation for that).\n\n\nInstallation\n------------\n\nYou can install it via a package manager:\n\n[NPM](https://www.npmjs.org/):\n\n    $ npm install scrypt-async\n\n[Yarn](https://yarnpkg.com/):\n\n    $ yarn add scrypt-async\n\nor [download source code](https://github.com/dchest/scrypt-async-js/releases).\n\nTo improve performance with small interruptStep values, use `setImmediate` shim,\nsuch as \u003chttps://github.com/YuzuJS/setImmediate\u003e.\n\n\nUsage\n-----\n\n### Modern API\n\n#### scrypt(password, salt, options, callback)\n\nDerives a key from password and salt and calls callback\nwith derived key as the only argument.\n\nIf interruptStep is set, calculations are interrupted with setImmediate (or\nzero setTimeout) at the given interruptSteps to avoid freezing the browser.\nIf it's not set or set to zero, the callback is called immediately after the\ncalculation, avoiding setImmediate.\n\n#### Arguments:\n\n* *password* — password (`string` or `Array` of bytes or `Uint8Array`)\n* *salt* — salt (`string` or `Array` of bytes or `Uint8Array`)\n* *options* — object with key derivation options\n* *callback* — callback function receiving result (`function (Array|Uint8Array|string)`)\n\n##### Options:\n\n* `N` — CPU/memory cost parameter (must be power of two;\n  alternatively, you can specify `logN` where *N = 2^logN*).\n* `r` — block size parameter\n* `p` — parallelization parameter (default is 1)\n* `dkLen` — derived key length (default is 32)\n* `interruptStep` — (optional) the amount of loop cycles to execute before the next setImmediate/setTimeout (defaults to 0)\n* `encoding` — (optional) result encoding `'base64'` or `'hex'` (result will be a `string`), `'binary'` (result will be a `Uint8Array`) or undefined (result will be an `Array` of bytes).\n\n#### Example:\n\n```javascript\nscrypt('mypassword', 'saltysalt', {\n    N: 16384,\n    r: 8,\n    p: 1,\n    dkLen: 16,\n    encoding: 'hex'\n}, function(derivedKey) {\n    console.log(derivedKey); // \"5012b74fca8ec8a4a0a62ffdeeee959d\"\n});\n```\n\n### Legacy API (deprecated)\n\n#### scrypt(password, salt, logN, r, dkLen, [interruptStep], callback, [encoding])\n\nLegacy API doesn't support parallelization parameter greater than 1.\n\n##### Arguments:\n\n* *password* — password (`string` or `Array` of bytes or `Uint8Array`)\n* *salt* — salt (`string` or `Array` of bytes or `Uint8Array`)\n* *logN* — CPU/memory cost parameter (1 to 31)\n* *r* — block size parameter\n* *dkLen* — length of derived key\n* *interruptStep* — (optional) the amount of loop cycles to execute before the next setImmediate/setTimeout (defaults to 1000)\n* *callback* — callback function receiving result (`function (Array|Uint8Array|string)`)\n* *encoding* — (optional) result encoding (`'base64'`, `'hex'`, `'binary'` or undefined).\n\nWhen encoding is not set, the result is an `Array` of bytes.\n\n\nLicense\n-------\n\nBSD-like, see LICENSE file or MIT license at your choice.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fscrypt-async-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchest%2Fscrypt-async-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fscrypt-async-js/lists"}