MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / keyhash

Function keyhash

LuaSTGPlus/string2enum.py:76–80  ·  view source on GitHub ↗
(key, rand_table, idx_list, n)

Source from the content-addressed store, hash-verified

74 return None
75
76def keyhash(key, rand_table, idx_list, n):
77 ret = 0
78 for i in range(0, len(idx_list)):
79 ret += ord(charat(key, idx_list[i])) * rand_table[i]
80 return ret % n
81
82def generate_graph(key_list, idx_list, factor):
83 n = int(len(key_list) * factor + 1)

Callers 2

generate_graphFunction · 0.85
final_hash_funcFunction · 0.85

Calls 1

charatFunction · 0.85

Tested by

no test coverage detected