scrypt-async-modern
Advanced tools
Comparing version 3.0.9 to 3.0.10
@@ -0,1 +1,5 @@ | ||
## 3.0.10 - 2019-01-05 | ||
- Add method overloading for result | ||
## 3.0.9 - 2019-01-05 | ||
@@ -2,0 +6,0 @@ |
@@ -6,3 +6,3 @@ /*! | ||
*/ | ||
export interface IScryptOptions { | ||
export interface IScryptBaseOptions { | ||
N?: number; | ||
@@ -14,2 +14,4 @@ logN?: number; | ||
interruptStep?: number; | ||
} | ||
export interface IScryptOptions extends IScryptBaseOptions { | ||
encoding?: "base64" | "hex" | "binary"; | ||
@@ -48,2 +50,13 @@ } | ||
*/ | ||
export default function scrypt(password: any, salt: any, { N, logN, r, p, dkLen, interruptStep, encoding }?: IScryptOptions): Promise<unknown>; | ||
export default function scrypt(password: any, salt: any, options?: IScryptBaseOptions & { | ||
encoding?: null | unknown; | ||
}): Promise<number[]>; | ||
export default function scrypt(password: any, salt: any, options?: IScryptBaseOptions & { | ||
encoding: "hex"; | ||
}): Promise<string>; | ||
export default function scrypt(password: any, salt: any, options?: IScryptBaseOptions & { | ||
encoding: "base64"; | ||
}): Promise<string>; | ||
export default function scrypt(password: any, salt: any, options?: IScryptBaseOptions & { | ||
encoding: "binary"; | ||
}): Promise<Uint8Array>; |
@@ -15,33 +15,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* scrypt(password, salt, options): Promise | ||
* | ||
* where | ||
* | ||
* password and salt are strings or arrays of bytes (Array of Uint8Array) | ||
* options is | ||
* | ||
* { | ||
* N: // CPU/memory cost parameter, must be power of two, | ||
* // default = 16384 | ||
* // (alternatively, you can specify logN) | ||
* r: // block size, default = 8 | ||
* p: // parallelization parameter, default = 1 | ||
* dkLen: // length of derived key, default = 32 | ||
* encoding: // optional encoding: | ||
* "base64" - standard Base64 encoding | ||
* "hex" — hex encoding, | ||
* "binary" — Uint8Array, | ||
* undefined/null - Array of bytes (default) | ||
* interruptStep: // optional, steps to split calculations, default = 0 | ||
* } | ||
* | ||
* Derives a key from password and salt and fulfills Promise | ||
* with derived key as the only argument. | ||
* | ||
* Calculations are interrupted with setImmediate (or zero setTimeout) at the | ||
* given interruptSteps to avoid freezing the browser. If it's undefined or zero, | ||
* the callback is called immediately after the calculation, avoiding setImmediate. | ||
* | ||
*/ | ||
function scrypt(password, salt, _a) { | ||
@@ -48,0 +17,0 @@ var _b = _a === void 0 ? {} : _a, _c = _b.N, N = _c === void 0 ? 16384 : _c, logN = _b.logN, _d = _b.r, r = _d === void 0 ? 8 : _d, _e = _b.p, p = _e === void 0 ? 1 : _e, _f = _b.dkLen, dkLen = _f === void 0 ? 32 : _f, _g = _b.interruptStep, interruptStep = _g === void 0 ? 0 : _g, encoding = _b.encoding; |
{ | ||
"name": "scrypt-async-modern", | ||
"version": "3.0.9", | ||
"version": "3.0.10", | ||
"description": "Fast \"async\" scrypt implementation in modern JavaScript.", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"build": "tsc", | ||
"format": "prettier --write src", | ||
"format": "prettier --write 'src/**'", | ||
"prepack": "rimraf dist && npm run build", | ||
@@ -31,0 +31,0 @@ "test": "jest" |
Sorry, the diff of this file is not supported yet
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
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
0
53794
617