Created
May 8, 2024 04:26
-
-
Save ardislu/8454b9758a8dbef594090c5ff2a63a22 to your computer and use it in GitHub Desktop.
Golfed ROT13 in JavaScript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ignores input casing, output will be all lowercase. | |
const r=s=>s.replace(/[a-z]/gi,c=>(((parseInt(c,36)+3)%26)+10).toString(36)); | |
// r('the quick brown fox jumps over the lazy dog') | |
// 'gur dhvpx oebja sbk whzcf bire gur ynml qbt' | |
// r('gur dhvpx oebja sbk whzcf bire gur ynml qbt') | |
// 'the quick brown fox jumps over the lazy dog' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment