src/index.js
function privateToPublic(privateKey) {
  if (typeof privateKey !== 'string') { throw new Error(`[ethjs-account] private key must be type String, got ${typeof(privateKey)}`); }
  if (!privateKey.match(/^(0x)?[0-9a-fA-F]{64}$/)) { throw new Error('[ethjs-account] private key must be an alphanumeric hex string that is 32 bytes long.'); }

  const privateKeyBuffer = new Buffer(stripHexPrefix(privateKey), 'hex');
  return (new Buffer(secp256k1.keyFromPrivate(privateKeyBuffer).getPublic(false, 'hex'), 'hex')).slice(1);
}
function privateToPublic(privateKey) {
  if (typeof privateKey !== 'string') { throw new Error(`[ethjs-account] private key must be type String, got ${typeof(privateKey)}`); }
  if (!privateKey.match(/^(0x)?[0-9a-fA-F]{64}$/)) { throw new Error('[ethjs-account] private key must be an alphanumeric hex string that is 32 bytes long.'); }

  const privateKeyBuffer = new Buffer(stripHexPrefix(privateKey), 'hex');
  return (new Buffer(secp256k1.keyFromPrivate(privateKeyBuffer).getPublic(false, 'hex'), 'hex')).slice(1);
}
function privateToPublic ( privateKey ) { if ( typeof privateKey !== 'string' ) { throw new Error ( ` ${ typeof ( privateKey ) } ` ) ; } if ( ! privateKey . match ( / ^(0x)?[0-9a-fA-F]{64}$ / ) ) { throw new Error ( '[ethjs-account] private key must be an alphanumeric hex string that is 32 bytes long.' ) ; } const privateKeyBuffer = new Buffer ( stripHexPrefix ( privateKey ) , 'hex' ) ; return ( new Buffer ( secp256k1 . keyFromPrivate ( privateKeyBuffer ) . getPublic ( false , 'hex' ) , 'hex' ) ) . slice ( 1 ) ; }
Returns the public key for this private key.

@method privateToPublic
@param {String} privateKey a valid private key hex
@returns {Object} publicKey the sepk 160 byte public key for this private key
Returns the public key for this private key .