add simple strhash

This commit is contained in:
simon 2019-11-22 15:34:18 -05:00
parent 7d87fc1d9c
commit 7517d2b083
2 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,7 @@
import time
import siphash
last_time_called = dict()
@ -22,3 +24,13 @@ def rate_limit(per_second):
return decorate
Key = b"0123456789ABCDEF"
def strhash(str):
return siphash.SipHash24(Key, str.encode()).hash()
def signed64(i):
return -(i & 0x8000000000000000) | (i & 0x7fffffffffffffff)

View File

@ -1,2 +1,3 @@
ImageHash
influxdb
influxdb
siphash