you21979 / node-ripple-wallet-bip39

MIT License
0 stars 0 forks source link

エントロピー #1

Open you21979 opened 7 years ago

you21979 commented 7 years ago

bip32 master seed buffer ->64byte ripple encode -> 16byte

you21979 commented 7 years ago
function generateSeed() {
  var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

  assert(!options.entropy || options.entropy.length >= 16, 'entropy too short');
  var entropy = options.entropy ? options.entropy.slice(0, 16) : brorand(16);
  var type = options.algorithm === 'ed25519' ? 'ed25519' : 'secp256k1';
  return addressCodec.encodeSeed(entropy, type);
}