added code to initialize db with models and recodres
This commit is contained in:
18
backend/tools/helpers.py
Normal file
18
backend/tools/helpers.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import hashlib
|
||||
|
||||
|
||||
|
||||
def calculate_md5_checksum(string_to_md5_sum: str):
|
||||
return hashlib.md5(string_to_md5_sum.encode('utf-8')).hexdigest()
|
||||
|
||||
|
||||
def file_md5(fname: str) -> str:
|
||||
hash_md5 = hashlib.md5()
|
||||
with open(fname, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(4096), b""):
|
||||
hash_md5.update(chunk)
|
||||
return hash_md5.hexdigest()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(file_md5(__file__))
|
||||
Reference in New Issue
Block a user