hash-base
Abstract base class to inherit from if you want to create streams implementing the same API as node crypto Hash (for Cipher / Decipher check crypto-browserify/cipher-base).
Example
const HashBase = const inherits = // our hash function is XOR sum of all bytes { HashBase // in bytes this_sum = 0x00} MyHashprototype { for let i = 0; i < this_blocklength; ++i this_sum ^= this_blocki} MyHashprototype { return this_sum} const data = Bufferconst hash = console // => 67
You also can check source code or crypto-browserify/md5.js
LICENSE
MIT