decrypt static method

String decrypt(
  1. String key,
  2. String value
)

Decodes String from encrypted Value

Implementation

static String decrypt(String key, String value) {
  if (key.isEmpty) {
    return value;
  }
  List<String> keyList =
      key.runes.map((rune) => String.fromCharCode(rune)).toList();

  int currentKeyPos = 0;
  String result = "";

  List<String> tmp = value.split("a");
  for (String s in tmp) {
    result += _calculateKeyFromString(keyList[currentKeyPos], s, key);
    currentKeyPos++;
    if (currentKeyPos >= keyList.length) {
      currentKeyPos = 0;
    }
  }
  return result;
}