npm.io
1.2.6 • Published 2 years ago

@types/create-hash

Licence
MIT
Version
1.2.6
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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 1816 GMT
  • Dependencies: @types/node

Credits

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