@types/scrypt
TypeScript icon, indicating that this package has built-in type declarations

6.0.3 • Public • Published

Installation

npm install --save @types/scrypt

Summary

This package contains type definitions for scrypt (https://github.com/barrysteyn/node-scrypt).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scrypt.

index.d.ts

/// <reference types="node" />

export interface Params {
    N: number;
    r: number;
    p: number;
}

export function params(maxtime: number, maxmem?: number, maxmemfrac?: number): Promise<Params>;
export function params(maxtime: number, cb: (err: Error | null, obj: Params) => void): void;
export function params(maxtime: number, maxmem: number, cb: (err: Error | null, obj: Params) => void): void;
export function params(
    maxtime: number,
    maxmem: number,
    maxmemfrac: number,
    cb: (err: Error | null, obj: Params) => void,
): void;
export function paramsSync(maxtime: number, maxmem?: number, maxmemfrac?: number): Params;

export function kdf(key: string | Buffer, paramsObject: Params): Promise<Buffer>;
export function kdf(key: string | Buffer, paramsObject: Params, cb: (err: Error | null, obj: Buffer) => void): void;
export function kdfSync(key: string | Buffer, paramsObject: Params): Buffer;

export function verifyKdf(kdf: Buffer, key: string | Buffer): Promise<boolean>;
export function verifyKdf(kdf: Buffer, key: string | Buffer, cb: (err: Error | null, obj: boolean) => void): void;
export function verifyKdfSync(kdf: Buffer, key: string | Buffer): boolean;

export function hash(
    key: string | Buffer,
    params: Params,
    outputLength: number,
    salt: string | Buffer,
): Promise<Buffer>;
export function hash(
    key: string | Buffer,
    params: Params,
    outputLength: number,
    salt: string | Buffer,
    cb: (err: Error | null, obj: Buffer) => void,
): void;
export function hashSync(key: string | Buffer, params: Params, outputLength: number, salt: string | Buffer): Buffer;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by WhiteAbeLincoln.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/scrypt

Weekly Downloads

74

Version

6.0.3

License

MIT

Unpacked Size

5.88 kB

Total Files

5

Last publish

Collaborators

  • types