from __future__ import annotations

import json
from pathlib import Path
import time


def now_ts() -> int:
    return int(time.time())


def json_dumps(data: object) -> bytes:
    return json.dumps(data, ensure_ascii=False, separators=(",", ":")).encode("utf-8")


def safe_mkdir(path: Path) -> None:
    path.mkdir(parents=True, exist_ok=True)

