Created
February 27, 2025 17:18
-
-
Save meszaros-lajos-gyorgy/70de69fee8d51d0356e636124bea06fa to your computer and use it in GitHub Desktop.
fastlane forum text decoder
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
const lowerCaseVowels = 'aeiou' | |
const upperCaseVowels = 'AEIOU' | |
const lowerCaseConsonants = 'bcdfghjklmnpqrstvwxyz' | |
const upperCaseConsonants = 'BCDFGHJKLMNPQRSTVWXYZ' | |
function shiftLeft(needle, haystack) { | |
let index = haystack.indexOf(needle) | |
if (index === 0) { | |
index = haystack.length | |
} | |
return haystack[index - 1] | |
} | |
function decode(input) { | |
let chars = input.split('') | |
chars = chars.map(char => { | |
if (lowerCaseVowels.includes(char)) { | |
return shiftLeft(char, lowerCaseVowels) | |
} | |
if (upperCaseVowels.includes(char)) { | |
return shiftLeft(char, upperCaseVowels) | |
} | |
if (lowerCaseConsonants.includes(char)) { | |
return shiftLeft(char, lowerCaseConsonants) | |
} | |
if (upperCaseConsonants.includes(char)) { | |
return shiftLeft(char, upperCaseConsonants) | |
} | |
return char | |
}) | |
return chars.join('') | |
} | |
// source: https://www.thefastlaneforum.com/community/threads/ive-read-the-millionaire-fastlane.28234/post-141911 | |
// remove color:transparent from the block's css to make the text visible and remove user-select:none to be able to copy it | |
const str = `Sief ov. Muwi vji qesv ecuav jux qiuqmi esi xommoph vu vsefi 5 fezt gus 2 fezt ug gsiifun. Emtu moli jux zua quopv uav vjev zua tjuamfp'v katv hiv opvu e catopitt cetif up "fu xjev zua muwi". O xet duptvepvmz muuloph gus tunivjoph vu fu op vji humg opfatvsz cideati vjev't xjev O muwi vu fu. Pux O lpux O tjuamf katv gudat up nz neop catopitt xjodj emsiefz howit ni ipuahj gsiifun vu qmez humg qsivvz nadj xjipiwis O xepv.` | |
console.log(decode(str)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment