Last active
July 11, 2025 23:27
-
-
Save MarcelloDiSimone/dc8cf1b4757b9bb9d9e6214dc4d06f5f to your computer and use it in GitHub Desktop.
overengineered rot13
This file contains hidden or 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
function rot13(message){ | |
return [...message].map((c) => (n = c.charCodeAt(0),String.fromCharCode(n >= 65 && n <= 90?((n - 65 + 13) % 26) + 65:(n >= 97 && n <= 122 ? (n - 97 + 13) % 26 + 97 : n)))).join(''); | |
} | |
console.log(rot13('§""§$§Ruby is cool!')); // "grfg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment