diff --git a/Key.js b/Key.js
index 0f30616..550c40f 100644
--- a/Key.js
+++ b/Key.js
@@ -50,8 +50,6 @@ if (process.versions) {
};
kSpec.prototype.regenerateSync = function() {
-
-console.log('[Key.js.53]', this); //TODO
if (!this.private) {
throw new Error('Key does not have a private key set');
}
diff --git a/WalletKey.js b/WalletKey.js
index f651159..c2311a5 100644
--- a/WalletKey.js
+++ b/WalletKey.js
@@ -21,9 +21,7 @@ WalletKey.prototype.generate = function() {
WalletKey.prototype.storeObj = function() {
var pubKey = this.privKey.public.toString('hex');
-console.log('[WalletKey.js.23:pubKey:]',pubKey); //TODO
var pubKeyHash = coinUtil.sha256ripe160(this.privKey.public);
-console.log('[WalletKey.js.25:pubKeyHash:]', buffertools.toHex(pubKeyHash)); //TODO
var addr = new Address(this.network.addressPubkey, pubKeyHash);
var priv = new PrivateKey(this.network.keySecret, this.privKey.private, this.privKey.compressed);
var obj = {
diff --git a/examples/example.html b/examples/example.html
index 438472f..01f3174 100644
--- a/examples/example.html
+++ b/examples/example.html
@@ -55,7 +55,19 @@
var p = new bitcore.PeerManager();
print('
');
+ var coinUtil = bitcore.util;
+
+ var pk = '03d95e184cce34c3cfa58e9a277a09a7c5ed1b2a8134ea1e52887bc66fa3f47071'
+ var pubKeyHash = coinUtil.sha256(pk);
+ print(bitcore.buffertools.toHex(pubKeyHash));
+ pubKeyHash = coinUtil.sha256ripe160(pk);
+ print(bitcore.buffertools.toHex(pubKeyHash));
+
+ pubKeyHash = coinUtil.ripe160(new bitcore.Buffer('hola'));
+ print(bitcore.buffertools.toHex(pubKeyHash));
+
+ print('
');
var WalletKey = bitcore.WalletKey;
var networks = bitcore.networks;
diff --git a/test/test.util.js b/test/test.util.js
index e3de356..e224550 100644
--- a/test/test.util.js
+++ b/test/test.util.js
@@ -36,6 +36,23 @@ describe('util', function() {
});
});
});
+ describe('#sha256', function() {
+ var pk = '03d95e184cce34c3cfa58e9a277a09a7c5ed1b2a8134ea1e52887bc66fa3f47071'
+ it('should work for ' + pk, function() {
+ var pubKeyHash = coinUtil.sha256(pk);
+ var pkh = buffertools.toHex(pubKeyHash);
+ pkh.should.equal('a5c756101065ac5b8f689139e6d856fa99e54b5000b6428b43729d334cc9277d');
+ });
+ });
+
+ describe('#sha256ripe160', function() {
+ var pk = '03d95e184cce34c3cfa58e9a277a09a7c5ed1b2a8134ea1e52887bc66fa3f47071'
+ it('should work for ' + pk, function() {
+ var pubKeyHash = coinUtil.sha256ripe160(pk);
+ var pkh = buffertools.toHex(pubKeyHash);
+ pkh.should.equal('d166a41f27fd4b158f70314e5eee8998bf3d97d5');
+ });
+ });
describe('#ripemd160', function() {
var ripemdData = [
['somemessage123', '12fd01a7ec6b9ba23b3a5c16fbfab3ac19624a88'],