Comparing version 1.5.0 to 1.5.1
@@ -14,2 +14,3 @@ 'use strict'; | ||
var keyUtils = require('./key_utils'); | ||
var createHash = require('create-hash'); | ||
@@ -101,10 +102,12 @@ var G = secp256k1.G; | ||
/** | ||
@arg {string} role or smart contract permission name. | ||
@example masterPrivate.child('owner').child('active') | ||
@example masterPrivate.child('mycontract').child('myperm') | ||
@arg {string} name - child key name. | ||
@return {PrivateKey} | ||
@example activePrivate = masterPrivate.getChildKey('owner').getChildKey('active') | ||
@example activePrivate.getChildKey('mycontract').getChildKey('myperm') | ||
*/ | ||
var getChildKey = function getChildKey(role) { | ||
console.error('WARNING: getChildKey called, this needs testing against eosd'); | ||
return createHash('sha256').update(toBuffer()).update(role).digest(); | ||
}; | ||
function getChildKey(name) { | ||
console.error('WARNING: getChildKey untested against eosd'); | ||
var index = createHash('sha256').update(toBuffer()).update(name).digest(); | ||
return PrivateKey(index); | ||
} | ||
@@ -111,0 +114,0 @@ function toHex() { |
{ | ||
"name": "eosjs-ecc", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Elliptic curve cryptography functions", | ||
@@ -14,3 +14,3 @@ "keywords": "ECC, Private Key, Public Key, Signature, AES, Encryption, Decryption", | ||
"documentation": "node_modules/documentation/bin/documentation.js", | ||
"build": "npm run docs npm run build_lib && npm run build_browser", | ||
"build": "npm run docs && npm run build_lib && npm run build_browser", | ||
"build_lib": "node_modules/babel-cli/bin/babel.js src --out-dir lib", | ||
@@ -17,0 +17,0 @@ "build_browser": "mkdir -p dist && browserify -o dist/eosjs-ecc.js -s eosjs_ecc src/index.js && sha256sum dist/eosjs-ecc.js" |
Sorry, the diff of this file is too big to display
1346032
33385