Answer the question
In order to leave comments, you need to log in
How to write atbash cipher in 3 lines?
Hello, I would like to look at the atbash cipher code using recursion.
Answer the question
In order to leave comments, you need to log in
Python, example from here .
def atbash(s):
abc = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"
return s.translate(str.maketrans(
abc + abc.upper(), abc[::-1] + abc.upper()[::-1]))
print(atbash("Привет Мир!"))
const abc = "abcdefghijklmnopqrstuvwxyz", t = {};
for (let i = 0, j = abc.length; j;) t[abc.charAt(i++)] = abc.charAt(--j);
const atbash = s => s ? (t[s.charAt(0)] || s.charAt(0)) + atbash(s.slice(1)) : s;
console.log(atbash("hello, world!"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question