Ciphers

ROT-47

Shift 47 over the 94 printable ASCII characters, digits and punctuation included. Self-inverse.
IDrot4703 / 72classical · substitution-shift
Cipher / Shift

ROT-47

Shift 47 over printable ASCII.

Keyspace
1
Decode
self-inverse
Works on
ASCII 33-126, the rest passes
Family
3 in shift
no options

Access

Createcreate("rot47")
CLIciphers encode rot47 'Hello, World! 123'
Tryplayground with the sample above
Kincaesar, rot13

ROT-47 works on printable ASCII 33 to 126, so digits and punctuation change too. 47 is half of 94, so it's its own inverse. Space, tab and newline sit outside the range and pass through.

ts
const rot47 = create("rot47");
rot47.encode("Test 123!").text; // "%6DE `abP"
rot47.decode("%6DE `abP").text; // "Test 123!"
rot47.encode("A\tB\nC").text; // "p\tq\nr"

preserveCase means nothing here, upper and lower case are just different characters in the range. And stripNonAlpha would defeat the point.