toClassicAddress static method

String toClassicAddress(
  1. Uint8List public
)

Converts a public key to a classic XRP address.

Implementation

static String toClassicAddress(Uint8List public) {
  final h168 = hash160(public);
  if (h168.length != 20) {
    throw ArgumentError("invalid digest len");
  }
  final toNetworkBytes = Uint8List.fromList([0x0, ...h168]);
  return bs58.encodeCheck(toNetworkBytes, alphabet: bs58.ripple);
}