fmartingr.com-legacy/fmartingrcom/utils.py

9 lines
177 B
Python

# -*- coding: utf-8 -*-
import hashlib
def sha1_checksum(handler):
f = open(handler.file.name, 'rb')
checksum = hashlib.sha1(f.read())
return checksum.hexdigest()