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

1.2.6 • Public • Published

Installation

npm install --save @types/create-hash

Summary

This package contains type definitions for create-hash (https://github.com/crypto-browserify/createHash).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/create-hash.

index.d.ts

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

declare namespace createHash {
    type TypedArray =
        | Uint8Array
        | Uint8ClampedArray
        | Uint16Array
        | Uint32Array
        | Int8Array
        | Int16Array
        | Int32Array
        | Float32Array
        | Float64Array;

    interface HashAlgorithm {
        digest(target: encoding): string;
        digest(): Buffer;

        update(data: string | Buffer | TypedArray | DataView, encoding?: string): this;
        write(data: string | Buffer | TypedArray | DataView, encoding?: string): this;

        end(): void;
        read(): void;
    }

    type encoding = "utf8" | "hex" | "base64";
    type algorithm =
        | "md5"
        | "rmd160"
        | "ripemd160"
        | "sha"
        | "sha1"
        | "sha224"
        | "sha256"
        | "sha384"
        | "sha512";
}

declare function createHash(algorithm: createHash.algorithm, options?: any): createHash.HashAlgorithm;

export = createHash;

Additional Details

  • Last updated: Wed, 29 Nov 2023 18:36:16 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender, Konstantin Yuriev, and Max Boguslavskiy.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/create-hash

Weekly Downloads

56,795

Version

1.2.6

License

MIT

Unpacked Size

5.03 kB

Total Files

5

Last publish

Collaborators

  • types