packages/bitcoin-utils/lib/index.js
function compressPubKey (pubKey) {
  const x = pubKey.substring(2, 66)
  const y = pubKey.substring(66, 130)
  const even = parseInt(y.substring(62, 64), 16) % 2 === 0
  const prefix = even ? '02' : '03'

  return prefix + x
}
function compressPubKey (pubKey) {
  const x = pubKey.substring(2, 66)
  const y = pubKey.substring(66, 130)
  const even = parseInt(y.substring(62, 64), 16) % 2 === 0
  const prefix = even ? '02' : '03'

  return prefix + x
}
function compressPubKey ( pubKey ) { const x = pubKey . substring ( 2 , 66 ) const y = pubKey . substring ( 66 , 130 ) const even = parseInt ( y . substring ( 62 , 64 ) , 16 ) % 2 === 0 const prefix = even ? '02' : '03' return prefix + x }
Get compressed pubKey from pubKey.
@param {!string} pubKey - 65 byte string with prefix, x, y.
@return {string} Returns the compressed pubKey of uncompressed pubKey.
Get compressed pubKey from pubKey .