UNPKG

@muevoapp/js-ethereum-cryptography

Version:
12 lines (10 loc) 249 B
import { Hash } from "crypto"; export function createHashFunction( hashConstructor: () => Hash ): (msg: Buffer) => Buffer { return msg => { const hash = hashConstructor(); hash.update(msg); return Buffer.from(hash.digest()); }; }