Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generateSignature(...signingData) {
- const raw = web3Util.soliditySha3(...signingData);
- const salted = ethUtil.hashPersonalMessage(ethUtil.toBuffer(raw));
- const {
- v,
- r,
- s
- } = lodash.mapValues(ethUtil.ecsign(salted, ethUtil.toBuffer('0x'+user.pk.trim())), (value, key) => key === 'v' ? value : ethUtil.bufferToHex(value));
- //console.log("Signature complete! ", v, r, s);
- return {v: v, r: r, s: s};
- }
Add Comment
Please, Sign In to add comment