mirror of
https://github.com/simon987/hexlib.git
synced 2025-04-19 17:56:43 +00:00
add simple strhash
This commit is contained in:
parent
7d87fc1d9c
commit
7517d2b083
@ -1,5 +1,7 @@
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
|
import siphash
|
||||||
|
|
||||||
last_time_called = dict()
|
last_time_called = dict()
|
||||||
|
|
||||||
|
|
||||||
@ -22,3 +24,13 @@ def rate_limit(per_second):
|
|||||||
|
|
||||||
return decorate
|
return decorate
|
||||||
|
|
||||||
|
|
||||||
|
Key = b"0123456789ABCDEF"
|
||||||
|
|
||||||
|
|
||||||
|
def strhash(str):
|
||||||
|
return siphash.SipHash24(Key, str.encode()).hash()
|
||||||
|
|
||||||
|
|
||||||
|
def signed64(i):
|
||||||
|
return -(i & 0x8000000000000000) | (i & 0x7fffffffffffffff)
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
ImageHash
|
ImageHash
|
||||||
influxdb
|
influxdb
|
||||||
|
siphash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user