ethers.js/packages/keccak256/src.ts/index.ts

10 lines
217 B
TypeScript
Raw Normal View History

2019-05-15 01:25:46 +03:00
"use strict";
import sha3 = require("js-sha3");
import { arrayify, BytesLike } from "@ethersproject/bytes";
export function keccak256(data: BytesLike): string {
return '0x' + sha3.keccak_256(arrayify(data));
}