-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
43 lines (28 loc) · 818 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pyximport
import numpy
pyximport.install(setup_args={
'include_dirs': [numpy.get_include()]
})
import sse_match
if __name__ == '__main__':
# sse_match.run()
x = 'a'
a = x.__hash__()
keys = bytes([
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1
])
result = sse_match.find_matches(2, keys)
sse_match.print_bitmask(result)
zeros = sse_match.trailing_zeros(result)
print(f"python result: {result}")
print(f"Trailing zeros: {zeros}")
chars = ['x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm']
hash = ord('k')
keys = bytes(list(map(ord, chars)))
result = sse_match.find_matches(hash, keys)
zeros = sse_match.trailing_zeros(result)
print(f"Trailing zeros: {zeros}")
pass