Backend Stability, Basically functional.
This commit is contained in:
13
blake2tokenhasher-test/hashgen.py
Normal file
13
blake2tokenhasher-test/hashgen.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from hashlib import blake2b
|
||||
|
||||
def hash_token(token, secret, salt):
|
||||
# first iteration
|
||||
h1 = blake2b(digest_size=32)
|
||||
h1.update((token + secret + salt).encode("utf-8"))
|
||||
hash1 = h1.digest()
|
||||
# second iteration
|
||||
h2 = blake2b(digest_size=32)
|
||||
h2.update(hash1)
|
||||
return h2.hexdigest().lower()
|
||||
|
||||
print(hash_token("my-test-token", "local_dev_secret_change_for_production_12345678901234567890", "testgroup"))
|
||||
Reference in New Issue
Block a user