Browse Source

removed semicolons

master
JP Richardson 11 years ago
parent
commit
62196d9183
  1. 5
      CHANGELOG.md
  2. 22
      lib/hdkey.js

5
CHANGELOG.md

@ -1,3 +1,8 @@
x.y.z / 2014-06-dd
------------------
- removed semicolons per http://cryptocoinjs.com/about/contributing/#semicolons
-
0.0.1 / 2014-05-29 0.0.1 / 2014-05-29
------------------ ------------------
- initial release - initial release

22
lib/hdkey.js

@ -112,31 +112,31 @@ HDKey.prototype.getFingerprint = function() {
HDKey.prototype.derive = function(path) { HDKey.prototype.derive = function(path) {
var e = path.split('/'); var e = path.split('/')
// Special cases: // Special cases:
if (path == 'm' || path == 'M' || path == 'm\'' || path == 'M\'') if (path == 'm' || path == 'M' || path == 'm\'' || path == 'M\'')
return this; return this
var hkey = this; var hkey = this
for (var i in e) { for (var i in e) {
var c = e[i]; var c = e[i]
if (i == 0 ) { if (i == 0 ) {
if (c != 'm') throw new Error('invalid path'); if (c != 'm') throw new Error('invalid path')
continue; continue
} }
var usePrivate = (c.length > 1) && (c[c.length-1] == '\''); var usePrivate = (c.length > 1) && (c[c.length-1] == '\'')
var childIndex = parseInt(usePrivate ? c.slice(0, c.length - 1) : c) & 0x7fffffff; var childIndex = parseInt(usePrivate ? c.slice(0, c.length - 1) : c) & 0x7fffffff
if (usePrivate) if (usePrivate)
childIndex += HARDENED_OFFSET; childIndex += HARDENED_OFFSET
hkey = hkey.deriveChild(childIndex); hkey = hkey.deriveChild(childIndex)
} }
return hkey; return hkey
} }
HDKey.prototype.deriveChild = function(index) { HDKey.prototype.deriveChild = function(index) {

Loading…
Cancel
Save