pub fn atbash(text: &str) -> StringExpand description
Applies the Atbash cipher to a UTF-8 string, substituting only ASCII letters.
Each uppercase letter maps to its mirror: A→Z, B→Y, …, Z→A.
Lowercase letters mirror within their own range: a→z, b→y, …, z→a.
Case is preserved. All other bytes pass through unchanged. Applying this
function twice to the same input returns the original string.
§Examples
use rune_atbash::atbash;
assert_eq!(atbash("Hello, World!"), "Svool, Dliow!");
assert_eq!(atbash("Svool, Dliow!"), "Hello, World!");
assert_eq!(atbash("abcxyz"), "zyxcba");
assert_eq!(atbash("ABCXYZ"), "ZYXCBA");
assert_eq!(atbash("123 !@#"), "123 !@#");
assert_eq!(atbash(""), "");