Skip to content

Commit

Permalink
Mark cache key hash as not used for security
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed Jan 20, 2025
1 parent 8b1e7be commit 8abe659
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sri/hashers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def calculate_hash(path: Path, algorithm: Algorithm) -> str:

@lru_cache(maxsize=None)
def get_cache_key(path: Path, algorithm: Algorithm) -> str:
path_hash = hashlib.sha1(str(path).encode()).hexdigest()
path_hash = hashlib.sha1(str(path).encode(), usedforsecurity=False).hexdigest()
return f"sri-{path_hash}-{algorithm.value}"

0 comments on commit 8abe659

Please sign in to comment.