Skip to content

Add xxhash stub #4689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions third_party/2and3/xxhash.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import sys
from _typeshed import ReadableBuffer

if sys.version_info < (3,):
from hashlib import _hash as _Hash
else:
from hashlib import _Hash

VERSION: str
XXHASH_VERSION: str

class _IntDigestHash(_Hash):
def __init__(self, __string: ReadableBuffer = ...): ...
def intdigest(self) -> int: ...

# python-xxhash v2.0.0 does not support the string or usedforsecurity kwargs
class xxh32(_IntDigestHash): ...
class xxh64(_IntDigestHash): ...
class xxh3_64(_IntDigestHash): ...
class xxh3_128(_IntDigestHash): ...

def xxh32_digest(input: ReadableBuffer = ...) -> bytes: ...
def xxh32_intdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh32_hexdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh64_digest(input: ReadableBuffer = ...) -> bytes: ...
def xxh64_intdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh64_hexdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_64_digest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_64_intdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_64_hexdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_128_digest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_128_intdigest(input: ReadableBuffer = ...) -> bytes: ...
def xxh3_128_hexdigest(input: ReadableBuffer = ...) -> bytes: ...

xxh128 = xxh3_128
xxh128_digest = xxh3_128_digest
xxh128_intdigest = xxh3_128_intdigest
xxh128_hexdigest = xxh3_128_hexdigest