encodeAddress function

Uint8List encodeAddress(
  1. String a
)

Implementation

Uint8List encodeAddress(String a) {
  if (!Address.isAddress(a)) {
    throw Exception('Is not  valid address');
  }
  Uint8List encoded = hexToBytes(a);
  if(encoded.length != 20) {
    throw Exception("invalid address length");
  }
  return padLeft(encoded, 32);
}