Skip to content

Instantly share code, notes, and snippets.

@ktustanowski
Created August 4, 2017 21:49
Show Gist options
  • Save ktustanowski/cc5f09150c3363d64e22df2c4d488005 to your computer and use it in GitHub Desktop.
Save ktustanowski/cc5f09150c3363d64e22df2c4d488005 to your computer and use it in GitHub Desktop.
class AtbashDecryptor: Decryptor {
override func substitute(_ string: String) -> String {
guard let index = alphabet.index(of: string) else { return string }
return alphabet[alphabet.count - index - 1]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment