MCPcopy
hub / github.com/shadowsocks/shadowsocks / get_table

Function get_table

shadowsocks/crypto/table.py:37–46  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

35
36
37def get_table(key):
38 m = hashlib.md5()
39 m.update(key)
40 s = m.digest()
41 a, b = struct.unpack('<QQ', s)
42 table = maketrans(b'', b'')
43 table = [table[i: i + 1] for i in range(len(table))]
44 for i in range(1, 1024):
45 table.sort(key=lambda x: int(a % (ord(x) + i)))
46 return table
47
48
49def init_table(key):

Callers 2

init_tableFunction · 0.85
test_table_resultFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by 1

test_table_resultFunction · 0.68