mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
24 lines
578 B
TypeScript
24 lines
578 B
TypeScript
// Type definitions for sha256 0.2
|
|
// Project: https://github.com/cryptocoinjs/sha256
|
|
// Definitions by: Nathan Hardy <https://github.com/nhardy>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
|
|
type Message = string | Buffer | number[];
|
|
|
|
interface Sha256 {
|
|
(message: Message, options?: { asString: true }): string;
|
|
(message: Message, options: { asBytes: true }): number[];
|
|
}
|
|
|
|
interface Sha256WithX2 extends Sha256 {
|
|
x2: Sha256;
|
|
}
|
|
|
|
declare const sha256: Sha256WithX2;
|
|
|
|
export = sha256;
|
|
|
|
export as namespace sha256;
|