2021-08-08 23:58:01 +09:00
|
|
|
import hashlib
|
2021-10-05 21:14:19 +09:00
|
|
|
import logging
|
|
|
|
|
import time
|
2022-12-26 10:44:44 +00:00
|
|
|
|
2023-01-20 18:04:27 +00:00
|
|
|
from typing import Tuple
|
2021-08-08 23:58:01 +09:00
|
|
|
|
2021-10-05 21:14:19 +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-10-05 21:14:19 +09:00
|
|
|
|
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()
|