UNPKG

1.63 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/sha1`
3
4# Summary
5This package contains type definitions for sha1 (https://github.com/pvorb/node-sha1).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sha1.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sha1/index.d.ts)
10````ts
11// Type definitions for sha1 1.1
12// Project: https://github.com/pvorb/node-sha1
13// Definitions by: Bill Sourour <https://github.com/arcdev1>
14// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
16/// <reference types="node" />
17
18/**
19 * js function for hashing messages with SHA1
20 *
21 * @param message - a string or buffer to hash
22 * @param options - an options object
23 * @returns the resultant SHA1 hash of the given message
24 */
25declare function main(message: string | Buffer, options?: Sha1AsStringOptions): string;
26declare function main(message: string | Buffer, options?: Sha1AsBytesOptions): Uint8Array;
27declare function main(message: string | Buffer, options?: Sha1Options): string | Uint8Array;
28export = main;
29
30interface Sha1AsStringOptions {
31 asBytes?: false | undefined;
32 asString?: boolean | undefined;
33}
34
35interface Sha1AsBytesOptions {
36 asBytes: true;
37 asString?: false | undefined;
38}
39
40type Sha1Options = Sha1AsStringOptions | Sha1AsBytesOptions;
41
42````
43
44### Additional Details
45 * Last updated: Tue, 06 Jul 2021 16:34:40 GMT
46 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
47 * Global values: none
48
49# Credits
50These definitions were written by [Bill Sourour](https://github.com/arcdev1).
51
\No newline at end of file