Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 60c9eba

Browse files
committed
Use ethutil.bufferToHex
1 parent 603419a commit 60c9eba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ Wallet.prototype.getPrivateKey = function () {
3535
}
3636

3737
Wallet.prototype.getPrivateKeyString = function () {
38-
return '0x' + this.getPrivateKey().toString('hex')
38+
return ethUtil.bufferToHex(this.getPrivateKey())
3939
}
4040

4141
Wallet.prototype.getPublicKey = function () {
4242
return ethUtil.privateToPublic(this.privKey)
4343
}
4444

4545
Wallet.prototype.getPublicKeyString = function () {
46-
return '0x' + this.getPublicKey().toString('hex')
46+
return ethUtil.bufferToHex(this.getPublicKey())
4747
}
4848

4949
Wallet.prototype.getAddress = function () {
5050
return ethUtil.privateToAddress(this.privKey)
5151
}
5252

5353
Wallet.prototype.getAddressString = function () {
54-
return '0x' + this.getAddress().toString('hex')
54+
return ethUtil.bufferToHex(this.getAddress())
5555
}
5656

5757
Wallet.prototype.getChecksumAddressString = function () {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"homepage": "https://github.com/axic/ethereumjs-wallet",
2626
"dependencies": {
2727
"aes-js": "^0.2.3",
28-
"ethereumjs-util": "^4.1.0",
28+
"ethereumjs-util": "^4.2.0",
2929
"scrypt.js": "^0.1.0",
3030
"uuid": "^2.0.1",
3131
"utf8": "^2.1.1"

0 commit comments

Comments
 (0)