nesau
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user