strinifyPublicKey static method

String strinifyPublicKey(
  1. ECPublicKey publicKey
)

return a hex string version publicKey

Implementation

static String strinifyPublicKey(ECPublicKey publicKey) {
  assert(publicKey.Q != null);
  Uint8List compressedKey = publicKey.Q!.getEncoded(true);
  final codeList = compressedKey.toList();
  return codeList.map((w) {
    final hx = w.toRadixString(16);
    if (hx.length < 2) {
      return '0$hx';
    }
    return hx;
  }).join('');
  //print('bytes:${raw_bytes}');
  //var x_str = left_padding(publicKey.Q.x.toBigInteger().toRadixString(16), 64);
  //var y_str = left_padding(publicKey.Q.y.toBigInteger().toRadixString(16), 64);
  //return "${x_str}${y_str}";
}