Skip to content

Instantly share code, notes, and snippets.

@meszaros-lajos-gyorgy
Created February 27, 2025 17:18
Show Gist options
  • Save meszaros-lajos-gyorgy/70de69fee8d51d0356e636124bea06fa to your computer and use it in GitHub Desktop.
Save meszaros-lajos-gyorgy/70de69fee8d51d0356e636124bea06fa to your computer and use it in GitHub Desktop.
fastlane forum text decoder
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