Browse Source

hdkey: export HARDENED_OFFSET

master
JP Richardson 10 years ago
parent
commit
0a2cd67cea
  1. 5
      lib/hdkey.js
  2. 6
      test/hdkey.test.js

5
lib/hdkey.js

@ -6,8 +6,6 @@ var ecurve = require('ecurve')
var curve = ecurve.getCurveByName('secp256k1')
var Point = ecurve.Point
module.exports = HDKey
var MASTER_SECRET = new Buffer('Bitcoin seed')
var HARDENED_OFFSET = 0x80000000
var LEN = 78
@ -229,3 +227,6 @@ function hash160 (buf) {
var sha = crypto.createHash('sha256').update(buf).digest()
return crypto.createHash('rmd160').update(sha).digest()
}
HDKey.HARDENED_OFFSET = HARDENED_OFFSET
module.exports = HDKey

6
test/hdkey.test.js

@ -133,4 +133,10 @@ describe('hdkey', function () {
assert.equal(newKey.privateExtendedKey, expected)
})
})
describe('HARDENED_OFFSET', function () {
it('should be set', function () {
assert(HDKey.HARDENED_OFFSET)
})
})
})

Loading…
Cancel
Save