h160ToAddress method

String h160ToAddress(
  1. int addrType
)

Implementation

String h160ToAddress(int addrType) {
  if (length != 0x14) {
    throw Exception('Invalid h160 length');
  }
  List<int> x = [];
  x.add(addrType);
  x.addAll(this);
  x.addAll(Uint8List.fromList(x).dsha256.sublist(0, 4));
  return bs58.base58.encode(Uint8List.fromList(x));
}