Skip to content

Instantly share code, notes, and snippets.

@Spuffynism
Last active November 27, 2018 03:38
Show Gist options
  • Save Spuffynism/687db63083b0275a29e179cc685f834f to your computer and use it in GitHub Desktop.
Save Spuffynism/687db63083b0275a29e179cc685f834f to your computer and use it in GitHub Desktop.
Caesar Cypher
e=(m,a,b)=>m.replace(/./g,c=>String.fromCharCode(((c.charCodeAt()-65)*a+b)%26+65))
d=(m,a,b)=>m.replace(/./g,c=>String.fromCharCode(a*(c.charCodeAt()-39-b)%26+65))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment