encryptString static method

Future<String> encryptString(
  1. String txt,
  2. String key
)

Encrypts the txt with the given key.

The result of the encryption will be encoded by HEX. txt and key shoudn't be null.

Implementation

static Future<String> encryptString(String txt, String key) async {
  try {
    final String result =
        await _channel.invokeMethod('encrypt', {"input": txt, "key": key});
    return result;
  } on PlatformException catch (e) {
    throw "Failed to get string encoded: '${e.message}'.";
  }
}