Created
January 9, 2024 08:57
-
-
Save Cirras/7145e97d74b5754c92fc20dd1b6547b2 to your computer and use it in GitHub Desktop.
Checksum (dat002.edf) generation for the credits file (dat001.edf) from Endless Online.
This file contains 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
from pathlib import Path | |
def generate_checksum(dat001: Path) -> str: | |
file_size = dat001.stat().st_size | |
aeo_count = 0 | |
with open(dat001, 'r') as file: | |
for character in file.read(): | |
if character in ['a', 'A', 'e', 'E', 'o', 'O']: | |
aeo_count = aeo_count + 1 | |
return f"DAT001.ID{{{file_size * 3013 - 11}:145:{aeo_count}:{file_size * 21}}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment