mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
12 lines
249 B
TypeScript
12 lines
249 B
TypeScript
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());
|
|
};
|
|
}
|