Skip to content

Instantly share code, notes, and snippets.

@entyo entyo/i_love_onsya.ts Secret
Last active May 28, 2018

What would you like to do?
ROT13 decoder
function genLookUpTable(k: string, v: string) {
return k.split('').map((c, i) => { return { [c]: v[i] } }).reduce((a, c) => Object.assign(a, c))
function decodeROT13(code: string): string {
const lookupTable = genLookUpTable(
return code.split('').map(c => lookupTable[c]).join('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.