diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-11-23 04:06:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-23 04:06:03 +0800 |
commit | 1a8d95f5627aac6e122f7a1c905d2d23f5a0758d (patch) | |
tree | b1d114a2bbd18343d1502405b11b75b71a815716 /app | |
parent | ca819781cb68fc89af5a299df2710101b4b9cfe3 (diff) | |
parent | 6dad4f1f208cccaa3e37d8518e58942b8b1e6d57 (diff) | |
download | tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar.gz tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar.bz2 tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar.lz tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar.xz tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.tar.zst tangerine-wallet-browser-1a8d95f5627aac6e122f7a1c905d2d23f5a0758d.zip |
Merge pull request #871 from MetaMask/i860-ethjsremove
Phase out ethereumjs-util from encryptor module.
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/encryptor.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/scripts/lib/encryptor.js b/app/scripts/lib/encryptor.js index 2af2a1d2b..df72b62c0 100644 --- a/app/scripts/lib/encryptor.js +++ b/app/scripts/lib/encryptor.js @@ -1,5 +1,3 @@ -var ethUtil = require('ethereumjs-util') - module.exports = { // Simple encryption methods: @@ -101,10 +99,10 @@ function keyFromPassword (password) { } function serializeBufferFromStorage (str) { - str = ethUtil.stripHexPrefix(str) - var buf = new Uint8Array(str.length / 2) - for (var i = 0; i < str.length; i += 2) { - var seg = str.substr(i, 2) + var stripStr = (str.slice(0, 2) === '0x') ? str.slice(2) : str + var buf = new Uint8Array(stripStr.length / 2) + for (var i = 0; i < stripStr.length; i += 2) { + var seg = stripStr.substr(i, 2) buf[i / 2] = parseInt(seg, 16) } return buf |