From 65aaeb8b9d93d5e2db3ab1333c3c6ebc1b1103e5 Mon Sep 17 00:00:00 2001 From: JP Richardson Date: Sat, 14 Jun 2014 11:53:32 -0500 Subject: [PATCH] remove method getFingerprint(), add property fingerprint --- CHANGELOG.md | 1 + lib/hdkey.js | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e36903b..7bdec73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ x.y.z / 2014-06-dd - changed constructor from `new HDKey(masterSeed, [versions])` to `new HDKey([versions])` - added properties: `privateKey` and `publicKey` - removed method `getIdentifier()`, added property `identifier` +- removed method `getFingerprint()`, added property `fingerprint` 0.0.1 / 2014-05-29 ------------------ diff --git a/lib/hdkey.js b/lib/hdkey.js index ea22c63..8099162 100644 --- a/lib/hdkey.js +++ b/lib/hdkey.js @@ -27,11 +27,8 @@ function HDKey(versions) { this.chainCode = null } -Object.defineProperty(HDKey.prototype, 'identifier', { - get: function() { - return this._identifier - } -}) +Object.defineProperty(HDKey.prototype, 'fingerprint', {get: function() { return this.identifier.slice(0, 4) } }) +Object.defineProperty(HDKey.prototype, 'identifier', {get: function() { return this._identifier } }) Object.defineProperty(HDKey.prototype, 'privateKey', { get: function() { @@ -71,10 +68,6 @@ Object.defineProperty(HDKey.prototype, 'publicOld', { } }) -HDKey.prototype.getFingerprint = function() { - return this.identifier.slice(0, 4) -} - HDKey.prototype.derive = function(path) { var e = path.split('/') @@ -170,7 +163,7 @@ HDKey.prototype.deriveChild = function(index) { hd.chainCode = IR hd.depth = this.depth + 1 - hd.parentFingerprint = this.getFingerprint().readUInt32BE(0) + hd.parentFingerprint = this.fingerprint.readUInt32BE(0) hd.index = index return hd