str2ByteArray function

Uint8List str2ByteArray(
  1. String str, {
  2. String enc = '',
})

This is a utility function that is used by the keystore to decode strings that are used in the encrypted json

Implementation

Uint8List str2ByteArray(String str, {String enc = ''}) {
  if (enc == 'latin1') {
    return latin1.encode(str);
  } else {
    return Uint8List.fromList(Base58Encoder.instance.decode(str));
  }
}