Browse Source

implemented test encode method

master
JP Richardson 11 years ago
parent
commit
352b9b69e1
  1. 3
      package.json
  2. 6
      test/hdkey.test.js

3
package.json

@ -30,7 +30,8 @@
"homepage": "https://github.com/cryptocoinjs/hdkey",
"devDependencies": {
"terst": "^0.1.0",
"mocha": "^1.19.0"
"mocha": "^1.19.0",
"bs58": "^1.0.0"
},
"dependencies": {
"sha512": "0.0.1"

6
test/hdkey.test.js

@ -1,10 +1,14 @@
var crypto = require('crypto')
var bs58 = require('bs58')
var HDKey = require('../')
var fixtures = require('./fixtures')
require('terst')
function encode(buf) {
var hash = crypto.createHash('sha256').update(buf).digest()
var chksum = crypto.createHash('sha256').update(hash).digest().slice(0,4)
return bs58.encode(Buffer.concat([buf, chksum]))
}
describe('hdkey', function() {

Loading…
Cancel
Save