getAddress function

String getAddress(
  1. String inputString
)

Implementation

String getAddress(String inputString) {
  if (inputString.length > 27) {
    throw new ArgumentError("Can't create");
  }
  String string = '1' + inputString;
  for (var i = inputString.length; i < 34; i++) {
    final rng = Random.secure();
    string += (ALPHABET)[rng.nextInt(58)];
  }
  Uint8List buffer = base58.decode(string);
  Uint8List payload = buffer.sublist(0, buffer.length - 4);
  String address = encode(payload);
  return address;
}