ripple-address-codec
Advanced tools
Comparing version 1.5.2 to 1.6.0
{ | ||
"name": "ripple-address-codec", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "encodes/decodes base58 encoded ripple identifiers", | ||
@@ -9,11 +9,14 @@ "main": "src/index.js", | ||
"hash.js": "^1.0.3", | ||
"x-address-codec": "^0.5.0" | ||
"x-address-codec": "^0.6.0" | ||
}, | ||
"scripts": { | ||
"test": "istanbul test _mocha", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls" | ||
"prepublish": "npm test && npm run lint", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls", | ||
"lint": "if ! [ -f eslintrc ]; then curl -o eslintrc 'https://raw.githubusercontent.com/ripple/javascript-style-guide/master/eslintrc'; fi; eslint --reset -c eslintrc src/*.js test/*.js" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "~2.10.0", | ||
"eslint": "^0.24.1", | ||
"istanbul": "~0.3.5", | ||
"coveralls": "~2.10.0", | ||
"mocha": "^2.2.5" | ||
@@ -20,0 +23,0 @@ }, |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var hashjs = require('hash.js'); | ||
@@ -11,3 +13,3 @@ var apiFactory = require('x-address-codec'); | ||
module.exports = apiFactory({ | ||
sha256: function (bytes) { | ||
sha256: function(bytes) { | ||
return hashjs.sha256().update(bytes).digest(); | ||
@@ -17,3 +19,3 @@ }, | ||
codecMethods: { | ||
EdSeed : { | ||
EdSeed: { | ||
expectedLength: 16, | ||
@@ -28,7 +30,7 @@ version: ED25519_SEED | ||
}, | ||
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} | ||
} | ||
}); |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var assert = require('assert'); | ||
@@ -29,10 +31,12 @@ var api = require('../'); | ||
makeTest('NodePublic', 'n9MXXueo837zYH36DvMc13BwHcqtfAWNJY5czWVbp7uYTj7x17TH', | ||
'0388E5BA87A000CB807240DF8C848EB0B5FFA5C8E5A521BC8E105C0F0A44217828'); | ||
makeTest( | ||
'NodePublic', | ||
'n9MXXueo837zYH36DvMc13BwHcqtfAWNJY5czWVbp7uYTj7x17TH', | ||
'0388E5BA87A000CB807240DF8C848EB0B5FFA5C8E5A521BC8E105C0F0A44217828'); | ||
makeTest('K256Seed', 'sn259rEFXrQrWyx3Q7XneWcwV6dfL', | ||
'CF2DE378FBDD7E2EE87D486DFB5A7BFF'); | ||
makeTest('K256Seed', 'sn259rEFXrQrWyx3Q7XneWcwV6dfL', | ||
'CF2DE378FBDD7E2EE87D486DFB5A7BFF'); | ||
makeTest('EdSeed', 'sEdTM1uX8pu2do5XvTnutH6HsouMaM2', | ||
'4C3A1D213FBDFB14C7C28D609469B341'); | ||
makeTest('EdSeed', 'sEdTM1uX8pu2do5XvTnutH6HsouMaM2', | ||
'4C3A1D213FBDFB14C7C28D609469B341'); | ||
@@ -44,6 +48,14 @@ it('can decode arbitray seeds', function() { | ||
var decoded = api.decodeSeed('sn259rEFXrQrWyx3Q7XneWcwV6dfL'); | ||
assert.equal(toHex(decoded.bytes), 'CF2DE378FBDD7E2EE87D486DFB5A7BFF'); | ||
assert.equal(decoded.type, 'secp256k1'); | ||
var decoded2 = api.decodeSeed('sn259rEFXrQrWyx3Q7XneWcwV6dfL'); | ||
assert.equal(toHex(decoded2.bytes), 'CF2DE378FBDD7E2EE87D486DFB5A7BFF'); | ||
assert.equal(decoded2.type, 'secp256k1'); | ||
}); | ||
it('can pass a type as second arg to encodeSeed', function() { | ||
var edSeed = 'sEdTM1uX8pu2do5XvTnutH6HsouMaM2'; | ||
var decoded = api.decodeSeed(edSeed); | ||
assert.equal(toHex(decoded.bytes), '4C3A1D213FBDFB14C7C28D609469B341'); | ||
assert.equal(decoded.type, 'ed25519'); | ||
assert.equal(api.encodeSeed(decoded.bytes, decoded.type), edSeed); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8670
86
4
+ Addedx-address-codec@0.6.0(transitive)
- Removedx-address-codec@0.5.2(transitive)
Updatedx-address-codec@^0.6.0