Update x-address-codec dependency and add eslint

This commit is contained in:
Nicholas Dudfield
2015-07-31 16:36:33 +07:00
parent f79ca12a12
commit 8a2ce17676
4 changed files with 35 additions and 17 deletions

View File

@@ -1,3 +1,5 @@
'use strict';
var hashjs = require('hash.js');
var apiFactory = require('x-address-codec');
@@ -8,12 +10,12 @@ var FAMILY_SEED = 33;
var ED25519_SEED = [0x01, 0xE1, 0x4B];
module.exports = apiFactory({
sha256: function (bytes) {
sha256: function(bytes) {
return hashjs.sha256().update(bytes).digest();
},
defaultAlphabet: 'ripple',
codecMethods: {
EdSeed : {
EdSeed: {
expectedLength: 16,
version: ED25519_SEED
},
@@ -23,9 +25,9 @@ module.exports = apiFactory({
versions: [ED25519_SEED, FAMILY_SEED],
expectedLength: 16
},
AccountID: {version: ACCOUNT_ID },
NodePublic: {version: NODE_PUBLIC },
AccountID: {version: ACCOUNT_ID},
NodePublic: {version: NODE_PUBLIC},
NodePrivate: {version: NODE_PRIVATE},
K256Seed : {version: FAMILY_SEED }
K256Seed: {version: FAMILY_SEED}
}
});