Browse Source

remove method getFingerprint(), add property fingerprint

master
JP Richardson 11 years ago
parent
commit
65aaeb8b9d
  1. 1
      CHANGELOG.md
  2. 13
      lib/hdkey.js

1
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
------------------

13
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

Loading…
Cancel
Save