Skip to content

Instantly share code, notes, and snippets.

@AdamGold
Last active April 12, 2026 18:34
Show Gist options
  • Select an option

  • Save AdamGold/19fd9489a6160a14b0fcf291af50993b to your computer and use it in GitHub Desktop.

Select an option

Save AdamGold/19fd9489a6160a14b0fcf291af50993b to your computer and use it in GitHub Desktop.

Fix for encode_message()

The XOR key should be 42, not 7.

Corrected function:

def encode_message(message: str) -> str:
    return "".join(chr(ord(c) ^ 42) for c in message)

Test: encode_message("hello") should return "BOFFE".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment