npm.io
1.2.4 • Published 2 years ago

@types/sha512-universal

Licence
MIT
Version
1.2.4
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/sha512-universal

Summary

This package contains type definitions for sha512-universal (https://github.com/chm-diederichs/sha512-universal#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sha512-universal.

index.d.ts

export = Sha512;

declare function Sha512(): Sha512.Sha512;

declare namespace Sha512 {
    const WASM_SUPPORTED: boolean;
    const WASM_LOADED: boolean;
    const SHA512_BYTES: 64;
    const HMAC: HMACCtor | undefined;

    function ready(cb: () => void): void;

    interface Sha512 {
        update(input: Uint8Array | readonly number[]): this;
        update(input: string, encoding?: string): this;
        digest<TBuf extends Uint8Array = Uint8Array>(enc?: TBuf, offset?: number): TBuf;
        digest(enc: string): string;
    }

    interface HMACCtor {
        (key: Uint8Array): HMAC;
        new(key: Uint8Array): HMAC;
    }

    interface HMAC {
        update(input: Uint8Array | readonly number[]): this;
        update(input: string, encoding?: string): this;
        digest<TBuf extends Uint8Array = Uint8Array>(enc?: TBuf, offset?: number): TBuf;
        digest(enc: string): string;
    }
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.