| 1 | from _typeshed import SupportsLenAndGetItem |
| 2 | from hmac import compare_digest as compare_digest |
| 3 | from random import SystemRandom as SystemRandom |
| 4 | from typing import Final, TypeVar |
| 5 | |
| 6 | __all__ = ["choice", "randbelow", "randbits", "SystemRandom", "token_bytes", "token_hex", "token_urlsafe", "compare_digest"] |
| 7 | |
| 8 | _T = TypeVar("_T") |
| 9 | |
| 10 | DEFAULT_ENTROPY: Final[int] |
| 11 | |
| 12 | def randbelow(exclusive_upper_bound: int) -> int: ... |
| 13 | def randbits(k: int) -> int: ... |
| 14 | def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ... |
| 15 | def token_bytes(nbytes: int | None = None) -> bytes: ... |
| 16 | def token_hex(nbytes: int | None = None) -> str: ... |
| 17 | def token_urlsafe(nbytes: int | None = None) -> str: ... |