From 49b21f122a232330f7efc499095d8d80f7895a20 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 15 Feb 2017 19:45:03 +1100 Subject: Ethereum addresses include checksum --- src/js/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/js') diff --git a/src/js/index.js b/src/js/index.js index 41f8260..4c947a4 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -569,7 +569,9 @@ var privKeyBuffer = key.privKey.d.toBuffer(); privkey = privKeyBuffer.toString('hex'); var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); - address = "0x" + addressBuffer.toString('hex'); + var hexAddress = addressBuffer.toString('hex'); + var checksumAddress = ethUtil.toChecksumAddress(hexAddress); + address = ethUtil.addHexPrefix(checksumAddress); } addAddressToList(indexText, address, pubkey, privkey); }, 50) -- cgit v1.2.3