compressPublicKey function

Uint8List compressPublicKey(
  1. Uint8List compressedPubKey
)

Given a byte array computes its compressed version and returns it as a byte array, including the leading 02 or 03

Implementation

Uint8List compressPublicKey(Uint8List compressedPubKey) {
  return Uint8List.view(
    params.curve.decodePoint(compressedPubKey)!.getEncoded(true).buffer,
  );
}