aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/encryptor.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-23 07:36:50 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-23 07:36:50 +0800
commit2966d46fa29641ad478cc83b5ee4c6c8adf1c63b (patch)
tree6f2e4e3fffa6728d29482e2c475273b4510ac880 /app/scripts/lib/encryptor.js
parent136296aad6058c4bea8c3083e8ae553b2afcab98 (diff)
parentc8176c9439cebf2cf65efbc73a633f8e1b643128 (diff)
downloadtangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar.gz
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar.bz2
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar.lz
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar.xz
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.tar.zst
tangerine-wallet-browser-2966d46fa29641ad478cc83b5ee4c6c8adf1c63b.zip
Merge branch 'dev' into i843-MoveSaltIntoEncryptor
Diffstat (limited to 'app/scripts/lib/encryptor.js')
-rw-r--r--app/scripts/lib/encryptor.js10
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