From 6dad4f1f208cccaa3e37d8518e58942b8b1e6d57 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 22 Nov 2016 11:17:05 -0800 Subject: Phase out ethereumjs-util from encryptor module. --- app/scripts/lib/encryptor.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'app') 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 -- cgit v1.2.3