cypherDecrypt function
Decrypts a string encrypted with cypherEncrypt.
Implementation
String cypherDecrypt(
String encoded, {
String sequence = defaultSequence,
int steps = 1,
}) {
final decrypted = encoded.split('').map((char) {
final idx = sequence.indexOf(char);
if (idx == -1) {
// char not in sequence -> leave unchanged
return char;
}
return sequence[(idx - steps + sequence.length) % sequence.length];
}).join();
return decrypted;
}