diff --git a/app/models/attachement.py b/app/models/attachement.py index 0634847..cbc5ace 100644 --- a/app/models/attachement.py +++ b/app/models/attachement.py @@ -22,11 +22,11 @@ class Attachement(db.Model): def __init__(self, file, comment): self.name = file.filename self.size = os.stat(file).st_size - self.hashed = str(hash_file(file)) + self.hashed = hash_file(file) self.comment = comment def hash_file(file): with open(file,"rb") as f: bytes = f.read() # read entire file as bytes - hashed = hashlib.sha256(bytes).hexdigest() + hashed = sha256(bytes).hexdigest() return hashed \ No newline at end of file