Files
sarif-cli/sarif_cli/hash.py
2022-11-07 13:56:50 -05:00

8 lines
230 B
Python

from hashlib import blake2b
# takes a bytes object and outputs an 8 byte hash
def hash_unique(item_to_hash):
h = blake2b(digest_size = 8)
h.update(item_to_hash)
return abs(int.from_bytes(h.digest(), byteorder='big'))