This commit is contained in:
Nikolaj
2022-01-14 10:40:45 +01:00
parent 0ef63ca80b
commit bcffb44393
10 changed files with 16 additions and 11 deletions

View File

@ -1,5 +1,6 @@
import string
import pathlib
import time
from PIL import ImageFont
BASE64_DIGITS = string.digits + string.ascii_letters + "+_"
@ -29,12 +30,18 @@ def write_file(path: str, game: dict):
def base64(num: int) -> str:
temp = ""
while num > 0:
for _ in range(10):
temp = BASE64_DIGITS[num % 64] + temp
num = num//64
if num > 0:
raise Exception()
return temp
def gen_id() -> str:
micro_seconds = int(time.time() * 1000000)
return base64((micro_seconds * 9876534021204356789) % 0xfffffffffffffff)
def make_fonts():
with open("font-list.txt", "r", encoding="utf-8") as file_pointer: