Created
December 11, 2024 17:07
-
-
Save rccarlson/4245ec7888a61a1ad0ca49c5d4b04be0 to your computer and use it in GitHub Desktop.
Generate Covenant Eyes Developer Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Generates today's code for accessing the Covenant Eyes developer menu. | |
| Developer code is a truncated MD5 hash of the current date, with some formatting applied | |
| """ | |
| import hashlib, datetime | |
| # get current date as ddmmyyyy | |
| today = datetime.datetime.now().strftime(R"%d%m%Y") | |
| # generate md5 hash of current date, surrounded by "SDsalt" | |
| md5_hash = hashlib.md5() | |
| md5_hash.update(f"SDsalt{today}SDsalt".encode('utf-8')) | |
| hex_code = md5_hash.hexdigest() | |
| # swap letters in the hex code with numbers | |
| # truncate code to 9 characters | |
| translation_table = str.maketrans('abcdef','012345') | |
| code = hex_code[0:9].translate(translation_table) | |
| # format the code in groups of 3, separated by dashes | |
| formatted_code = f"{code[0:3]}-{code[3:6]}-{code[6:9]}" | |
| print(formatted_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment