Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
eth-crypto/dist/es/hash.js

16 lines
431 B

import { utils as ethersUtils } from 'ethers';
export function keccak256(params) {
var types = [];
var values = [];
if (!Array.isArray(params)) {
types.push('string');
values.push(params);
} else {
params.forEach(function (p) {
types.push(p.type);
values.push(p.value);
});
}
return ethersUtils.solidityKeccak256(types, values);
}
export var SIGN_PREFIX = '\x19Ethereum Signed Message:\n32';