hashToAddress static method

String hashToAddress(
  1. List<int> addrHash
)

Generates an XRP (Ripple) address from the provided address hash.

This method takes an address hash as input and encodes it into an XRP address using the Base58Check encoding with the prefix specified in CoinsConf.ripple.params.p2pkhNetVer.

addrHash The address hash used to generate the XRP address. returns The generated XRP address as a Base58Check encoded string. throws ArgumentException if the address hash length is not equal to QuickCrypto.hash160DigestSize.

Implementation

static String hashToAddress(List<int> addrHash) {
  if (addrHash.length != QuickCrypto.hash160DigestSize) {
    throw AddressConverterException(
        "address hash must be ${QuickCrypto.hash160DigestSize} bytes length but got ${addrHash.length}");
  }

  return Base58Encoder.checkEncode(
      List<int>.from([...CoinsConf.ripple.params.p2pkhNetVer!, ...addrHash]),
      Base58Alphabets.ripple);
}