MCPcopy Create free account
hub / github.com/tensorflow/datasets / _hkey_to_bytes

Function _hkey_to_bytes

tensorflow_datasets/core/shuffle.py:60–63  ·  view source on GitHub ↗

Converts 128 bits integer hkey to binary representation.

(hkey: int)

Source from the content-addressed store, hash-verified

58
59
60def _hkey_to_bytes(hkey: int) -> bytes:
61 """Converts 128 bits integer hkey to binary representation."""
62 max_int64 = 0xFFFFFFFFFFFFFFFF
63 return struct.pack('=QQ', (hkey >> 64) & max_int64, hkey & max_int64)
64
65
66def _read_hkey(buff: bytes) -> int:

Callers 1

addMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected