added code to initialize db with models and recodres

This commit is contained in:
Tobias Kurze
2019-11-20 12:41:05 +01:00
parent bc1347fe99
commit 60ff5bdeaf
20 changed files with 1658 additions and 136 deletions

18
backend/tools/helpers.py Normal file
View 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__))