toHex method

String toHex({
  1. bool compressed = true,
})

returns the key as hex string (in SEC format - compressed by default)

Implementation

String toHex({bool compressed = true}) {
  final bytes = toBytes();
  if (compressed) {
    final point = reEncodedFromForm(bytes, true);
    return bytesToHex(point);
  }
  return bytesToHex(bytes);
}