Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scrypt-async-modern

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrypt-async-modern - npm Package Compare versions

Comparing version 3.0.9 to 3.0.10

4

CHANGELOG.md

@@ -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>;

31

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc