keyToString function

String keyToString(
  1. IKey key,
  2. String suffix,
  3. String prefix
)

Implementation

String keyToString(IKey key, String suffix, String prefix) {
  var digest = digestSuffixRipemd160(key.data, suffix);
  var whole = Uint8List(key.data.length + 4);
  for (var i = 0; i < key.data.length; ++i) {
    whole[i] = key.data[i];
  }
  for (var i = 0; i < 4; ++i) {
    whole[i + key.data.length] = digest[i];
  }
  return prefix + binaryToBase58(whole);
}