UNPKG

@types/blake2

Version:
55 lines (37 loc) 1.64 kB
# Installation > `npm install --save @types/blake2` # Summary This package contains type definitions for blake2 (https://github.com/vrza/node-blake2). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/blake2. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/blake2/index.d.ts) ````ts /// <reference types="node" /> import { BinaryToTextEncoding } from "crypto"; import { Transform, TransformOptions } from "stream"; export interface Blake2Options extends TransformOptions { digestLength: number; } export type Blake2Algorithm = "blake2b" | "blake2bp" | "blake2s" | "blake2sp" | "bypass"; export class Hash extends Transform { constructor(algorithm: Blake2Algorithm, options?: Blake2Options); update(buf: Buffer): this; digest(encoding: BinaryToTextEncoding): string; digest(): Buffer; copy(): this; } export function createHash(algorithm: Blake2Algorithm, options?: Blake2Options): Hash; export class KeyedHash extends Transform { constructor(algorithm: Blake2Algorithm, key: Buffer, options?: Blake2Options); update(buf: Buffer): this; digest(encoding: BinaryToTextEncoding): string; digest(): Buffer; copy(): this; } export function createKeyedHash(algorithm: Blake2Algorithm, key: Buffer, options?: Blake2Options): KeyedHash; ```` ### Additional Details * Last updated: Mon, 06 Nov 2023 22:41:04 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) # Credits These definitions were written by [Antoine Beauvais-Lacasse](https://github.com/beaulac).