Skip to content

Instantly share code, notes, and snippets.

@Cirras
Created January 9, 2024 08:57
Show Gist options
  • Save Cirras/7145e97d74b5754c92fc20dd1b6547b2 to your computer and use it in GitHub Desktop.
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.
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