mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
12 lines
326 B
Python
12 lines
326 B
Python
import hashlib
|
|
|
|
def compute_sha1_from_file(file_path):
|
|
with open(file_path, "rb") as file:
|
|
bytes = file.read()
|
|
readable_hash = compute_sha1_from_content(bytes)
|
|
return readable_hash
|
|
|
|
def compute_sha1_from_content(content):
|
|
readable_hash = hashlib.sha1(content).hexdigest()
|
|
return readable_hash
|