mirror of
https://github.com/simon987/hexlib.git
synced 2025-12-13 14:49:05 +00:00
add simple strhash
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user