Files
sarif-cli/sarif_cli/hash.py
Kristen Newbury 1a915e4de8 Update how project_id is generated
previously relied on assumption:
naming like: <org>/<project> in
repositoryUri
now just uses full repositoryUri
2023-01-05 16:37:55 -05:00

8 lines
225 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 int.from_bytes(h.digest(), byteorder='big')