toHex method

String toHex()

Returns the private key as a hexadecimal string with the appropriate prefix based on the algorithm.

Implementation

String toHex() {
  String toString = BytesUtils.toHexString(toBytes(), lowerCase: false);

  switch (algorithm) {
    case XRPKeyAlgorithm.ed25519:
      return "ED$toString";
    default:
      return "00$toString";
  }
}