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

4.0.4 • Public • Published

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

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

Credits

These definitions were written by Antoine Beauvais-Lacasse.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/blake2

Weekly Downloads

155

Version

4.0.4

License

MIT

Unpacked Size

4.61 kB

Total Files

5

Last publish

Collaborators

  • types