File: crypto.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (19 lines) | stat: -rw-r--r-- 573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from collections.abc import Callable
from hmac import HMAC

RANDOM_STRING_CHARS: str

class InvalidAlgorithm(ValueError): ...

def salted_hmac(
    key_salt: bytes | str, value: bytes | str, secret: bytes | str | None = None, *, algorithm: str = "sha1"
) -> HMAC: ...
def get_random_string(length: int, allowed_chars: str = ...) -> str: ...
def constant_time_compare(val1: bytes | str, val2: bytes | str) -> bool: ...
def pbkdf2(
    password: bytes | str,
    salt: bytes | str,
    iterations: int,
    dklen: int = 0,
    digest: Callable | None = None,
) -> bytes: ...