decodeUserData static method

String decodeUserData(
  1. String data
)

Implementation

static String decodeUserData(String data) {
  final key = encryptor.Key.fromLength(32);
  final iv = encryptor.IV.fromLength(16);
  final encrypter = encryptor.Encrypter(encryptor.AES(key));
  final decrypted = encrypter.decrypt64(data, iv: iv);
  final base64Str = convert.base64.decode(decrypted);
  final result = convert.utf8.decode(base64Str);
  return result;
}