UNPKG

893 BTypeScriptView Raw
1// Modified from the node.js definitions.
2// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/crypto.d.ts
3
4import { BinaryLike } from "crypto";
5export * from "crypto";
6
7export function pbkdf2(
8 password: BinaryLike,
9 salt: BinaryLike,
10 iterations: number,
11 keylen: number,
12 digest: string,
13 callback: (err: Error | null, derivedKey: Buffer) => any,
14): void;
15export function pbkdf2(
16 password: BinaryLike,
17 salt: BinaryLike,
18 iterations: number,
19 keylen: number,
20 digest: string,
21): Promise<Buffer>;
22
23export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
24export function randomBytes(size: number): Promise<Buffer>;
25
26export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
27export function pseudoRandomBytes(size: number): Promise<Buffer>;