MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / deterministic_random

Function deterministic_random

common/utils.py:114–117  ·  view source on GitHub ↗
(min_value, max_value, data)

Source from the content-addressed store, hash-verified

112
113
114def deterministic_random(min_value, max_value, data):
115 digest = hashlib.sha256(data.encode()).digest()
116 raw_value = int.from_bytes(digest[:4], byteorder='little', signed=False)
117 return int(raw_value / (2 ** 32 - 1) * (max_value - min_value)) + min_value
118
119
120def define_actions( action ):

Callers 2

fetchMethod · 0.90
fetchMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected