hashist
Provides you with a convenient hash function that uses Node's crypto module under the hood.
Install
npm install hashist --save
Usage
var hashist = ; // uses sha1 by default; # 2ef7bde608ce5404e97d5f042f95f89f1c232871
API
hashist(what: [String | Buffer], algorithm: String): String
hashist.stream(what: Readable, algorithm: String): Promise<String>
what
Can be a string or buffer. There is an API for streams that can be used. It is
hashist.stream
and it returns a Promise that results in the digest.
Examples
Use with strings
const hashist = ;console; // 2ef7bde608ce5404e97d5f042f95f89f1c232871
Use with buffers
const hashist = ;const buffer = 'Hello World!';console; // 2ef7bde608ce5404e97d5f042f95f89f1c232871
Use with streams
const hashist = ;const Readable = ; { super...args; this_sentText = false; } { if !this_sentText this; this_sentText = true; else this; }