MCPcopy
hub / github.com/apple/ml-4m / generate_uint15_hash

Function generate_uint15_hash

fourm/utils/misc.py:39–41  ·  view source on GitHub ↗

Generates a hash of the seed string as an unsigned int15 integer

(seed_str)

Source from the content-addressed store, hash-verified

37
38
39def generate_uint15_hash(seed_str):
40 """Generates a hash of the seed string as an unsigned int15 integer"""
41 return int(hashlib.sha256(seed_str.encode('utf-8')).hexdigest(), 16) % (2**15)
42
43
44# From PyTorch internals

Callers 1

modality_info.pyFile · 0.90

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected