ethers.js/packages/keccak256/lib/index.js

12 lines
448 B
JavaScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
"use strict";
2019-06-24 21:26:48 -04:00
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
2019-05-14 18:48:48 -04:00
Object.defineProperty(exports, "__esModule", { value: true });
2019-06-24 21:26:48 -04:00
var js_sha3_1 = __importDefault(require("js-sha3"));
2019-05-14 18:48:48 -04:00
var bytes_1 = require("@ethersproject/bytes");
function keccak256(data) {
2019-06-24 21:26:48 -04:00
return '0x' + js_sha3_1.default.keccak_256(bytes_1.arrayify(data));
2019-05-14 18:48:48 -04:00
}
exports.keccak256 = keccak256;