Skip to content

Instantly share code, notes, and snippets.

@krissemicolon
Created March 24, 2022 08:29
Show Gist options
  • Save krissemicolon/1f8c6b7103f2e8f51acc524947aebf6a to your computer and use it in GitHub Desktop.
Save krissemicolon/1f8c6b7103f2e8f51acc524947aebf6a to your computer and use it in GitHub Desktop.
pub fn xor(text: &str, key: u8) -> String {
text.chars().map(|c| ((c as u8) ^ key) as char).collect()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment