diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-02-28 02:28:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 02:28:31 +0800 |
commit | ab01fef1c0ffddf09a20f90a910e5e068cf8c71e (patch) | |
tree | 0fe9d0322bb39f42d3170b56d0eca7a90985400c /app/scripts/lib/sig-util.js | |
parent | 09c7b9d242f66db99c80f22fae00dfdb894e2adc (diff) | |
parent | c831043a5125c093a83857a335c7816627a7e291 (diff) | |
download | tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar.gz tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar.bz2 tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar.lz tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar.xz tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.tar.zst tangerine-wallet-browser-ab01fef1c0ffddf09a20f90a910e5e068cf8c71e.zip |
Merge pull request #1149 from MetaMask/i1114-AddPersonalSign
Add personal_sign
Diffstat (limited to 'app/scripts/lib/sig-util.js')
-rw-r--r-- | app/scripts/lib/sig-util.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/app/scripts/lib/sig-util.js b/app/scripts/lib/sig-util.js deleted file mode 100644 index 193dda381..000000000 --- a/app/scripts/lib/sig-util.js +++ /dev/null @@ -1,28 +0,0 @@ -const ethUtil = require('ethereumjs-util') - -module.exports = { - - concatSig: function (v, r, s) { - const rSig = ethUtil.fromSigned(r) - const sSig = ethUtil.fromSigned(s) - const vSig = ethUtil.bufferToInt(v) - const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64) - const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64) - const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig)) - return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex') - }, - - normalize: function (address) { - if (!address) return - return ethUtil.addHexPrefix(address.toLowerCase()) - }, - -} - -function padWithZeroes (number, length) { - var myString = '' + number - while (myString.length < length) { - myString = '0' + myString - } - return myString -} |