npm: possibly marvellous

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

    1.1.3 • Public • Published

    Installation

    npm install --save @types/sha1

    Summary

    This package contains type definitions for sha1 (https://github.com/pvorb/node-sha1).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sha1.

    index.d.ts

    // Type definitions for sha1 1.1
    // Project: https://github.com/pvorb/node-sha1
    // Definitions by: Bill Sourour <https://github.com/arcdev1>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference types="node" />
    
    /**
     * js function for hashing messages with SHA1
     *
     * @param message - a string or buffer to hash
     * @param options - an options object
     * @returns the resultant SHA1 hash of the given message
     */
    declare function main(message: string | Buffer, options?: Sha1AsStringOptions): string;
    declare function main(message: string | Buffer, options?: Sha1AsBytesOptions): Uint8Array;
    declare function main(message: string | Buffer, options?: Sha1Options): string | Uint8Array;
    export = main;
    
    interface Sha1AsStringOptions {
        asBytes?: false | undefined;
        asString?: boolean | undefined;
    }
    
    interface Sha1AsBytesOptions {
        asBytes: true;
        asString?: false | undefined;
    }
    
    type Sha1Options = Sha1AsStringOptions | Sha1AsBytesOptions;

    Additional Details

    • Last updated: Tue, 06 Jul 2021 16:34:40 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by Bill Sourour.

    Keywords

    none

    Install

    npm i @types/sha1

    DownloadsWeekly Downloads

    31,453

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    4.55 kB

    Total Files

    4

    Last publish

    Collaborators

    • types