scrypt-async-modern
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "scrypt-async-modern", | ||
"version": "3.0.1", | ||
"description": "Fast \"async\" scrypt implementation in modern JavaScript.", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/es/index.js", | ||
"jsnext:main": "dist/es/index.js", | ||
"scripts": { | ||
"test": "jest", | ||
"build": "rollup -c", | ||
"prettier": "prettier --write src/**/*.js" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.38", | ||
"babel-core": "^7.0.0-0", | ||
"@babel/preset-env": "^7.0.0-beta.38", | ||
"jest": "^22.1.4", | ||
"babel-jest": "^22.1.0", | ||
"rollup": "^0.55.1", | ||
"rollup-plugin-babel": "^4.0.0-beta.0", | ||
"prettier": "^1.10.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Cretezy/scrypt-async-modern.git" | ||
}, | ||
"keywords": [ | ||
"crypto", | ||
"cryptography", | ||
"scrypt", | ||
"password" | ||
], | ||
"author": "Charles Crete <charles@cretezy.com", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/Cretezy/scrypt-async-modern/issues" | ||
}, | ||
"homepage": "https://github.com/Cretezy/scrypt-async-modern" | ||
"name": "scrypt-async-modern", | ||
"version": "3.0.2", | ||
"description": "Fast \"async\" scrypt implementation in modern JavaScript.", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"watch": "noderize-scripts watch", | ||
"build": "noderize-scripts build", | ||
"start": "noderize-scripts start", | ||
"format": "noderize-scripts format", | ||
"test": "noderize-scripts test", | ||
"clean": "noderize-scripts clean", | ||
"prepack": | ||
"noderize-scripts clean && noderize-scripts build --env production" | ||
}, | ||
"devDependencies": { | ||
"noderize-scripts": "^0.3.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Cretezy/scrypt-async-modern.git" | ||
}, | ||
"keywords": ["crypto", "cryptography", "scrypt", "password"], | ||
"author": "Charles Crete <charles@cretezy.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/Cretezy/scrypt-async-modern/issues" | ||
}, | ||
"homepage": "https://github.com/Cretezy/scrypt-async-modern", | ||
"prettier": { | ||
"useTabs": true | ||
} | ||
} |
@@ -38,7 +38,16 @@ /*! | ||
*/ | ||
export default function scrypt(password, | ||
salt, | ||
{ N = 16384, logN, r = 8, p = 1, dkLen = 32, interruptStep = 0, encoding } = {}) { | ||
export default function scrypt( | ||
password, | ||
salt, | ||
{ | ||
N = 16384, | ||
logN, | ||
r = 8, | ||
p = 1, | ||
dkLen = 32, | ||
interruptStep = 0, | ||
encoding | ||
} = {} | ||
) { | ||
return new Promise((resolve, reject) => { | ||
if (!logN && !N) { | ||
@@ -66,3 +75,3 @@ return reject(new Error("scrypt: missing N or logN parameter")); | ||
if (r <= 0) { | ||
if (r < 1) { | ||
return reject(new Error("scrypt: invalid r")); | ||
@@ -76,3 +85,6 @@ } | ||
// Internal scrypt function | ||
function run({password, salt, N, r, p, dkLen, interruptStep, encoding }, callback) { | ||
function run( | ||
{ password, salt, N, r, p, dkLen, interruptStep, encoding }, | ||
callback | ||
) { | ||
function SHA256(m) { | ||
@@ -642,3 +654,3 @@ const K = [ | ||
(function performStep() { | ||
nextTick(function () { | ||
nextTick(function() { | ||
fn(start, start + step < end ? start + step : end); | ||
@@ -645,0 +657,0 @@ start += step; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251869
1
9
1784
1