Files

15 lines
315 B
Python
Raw Permalink Normal View History

2021-08-08 23:58:01 +09:00
import hashlib
import logging
import time
from typing import Tuple
2021-08-08 23:58:01 +09:00
logger = logging.getLogger(__name__)
_startup_time = int(time.time())
2022-02-20 09:21:38 -05:00
logger.info("Startup time: %s", _startup_time)
2021-08-26 14:49:33 -04:00
def gen_hash(key: Tuple[str, ...]) -> str:
2022-02-20 09:21:38 -05:00
return hashlib.sha256(str(key + (_startup_time,)).encode("utf-8")).hexdigest()