lib/util.js
function webidAndPrivKeyToAddress(webid, privKey, testnet) {
  if (typeof(privKey) === 'string') {
    privKey = new bitcore.HDPrivateKey(privKey)
  }
  var hash = sha2(webid)

  var ints = hashToInts(hash)

  var dep2 = privKey.derive(ints[0]).derive(ints[1]).derive(ints[2]).derive(ints[3])

  //console.log(dep2);

  if (testnet) {
    var address2 = dep2.privateKey
  } else {
    var address2 = dep2.privateKey
  }

  //console.log(address1);
  //console.log(address2);

  return address2
}
function webidAndPrivKeyToAddress(webid, privKey, testnet) {
  if (typeof(privKey) === 'string') {
    privKey = new bitcore.HDPrivateKey(privKey)
  }
  var hash = sha2(webid)

  var ints = hashToInts(hash)

  var dep2 = privKey.derive(ints[0]).derive(ints[1]).derive(ints[2]).derive(ints[3])

  //console.log(dep2);

  if (testnet) {
    var address2 = dep2.privateKey
  } else {
    var address2 = dep2.privateKey
  }

  //console.log(address1);
  //console.log(address2);

  return address2
}
function webidAndPrivKeyToAddress ( webid , privKey , testnet ) { if ( typeof ( privKey ) === 'string' ) { privKey = new bitcore . HDPrivateKey ( privKey ) } var hash = sha2 ( webid ) var ints = hashToInts ( hash ) var dep2 = privKey . derive ( ints [ 0 ] ) . derive ( ints [ 1 ] ) . derive ( ints [ 2 ] ) . derive ( ints [ 3 ] ) //console.log(dep2); if ( testnet ) { var address2 = dep2 . privateKey } else { var address2 = dep2 . privateKey } //console.log(address1); //console.log(address2); return address2 }
get an address from webid and hd priv key
@param  {String}  webid   The WebID
@param  {String}  pubKey  The HD private key
@param  {boolean} testnet Use testnet
@return {String}          bitcoin address
get an address from webid and hd priv key