Exemple #1
0
 public static string Decode(string cipheredText)
 {
     cipher = new MyAtbashCipher();
     return(string.Concat(cipheredText
                          .ToLower()
                          .Where(char.IsLetterOrDigit)
                          .Select(l => char.IsLetter(l) ? cipher.Decode(l) : l)));
 }
Exemple #2
0
    public static string Encode(string plainText)
    {
        cipher = new MyAtbashCipher();

        var cipherText = string.Concat(plainText
                                       .ToLower()
                                       .Where(char.IsLetterOrDigit)
                                       .Select(l => char.IsLetter(l) ? cipher.Encode(l) : l));

        return(string.Concat(GroupCipheredText(cipherText, ' ', 5)));
    }