import { ec as EC } from 'elliptic' ; const ec = new EC ( 'secp256k1' ) ; export function toCompressed ( uncompressed ) { return Buffer . from ( ec . keyFromPublic ( uncompressed . toString ( 'hex' ) , 'hex' ) . getPublic ( ) . encodeCompressed ( ) ) ; }