In Python 2, one could hash a string by just running:
someText = \"a\" hashlib.sha256(someText).hexdigest()
But in Python 3, it needs to be
Try opening the file in binary mode with open(fin, "rb").
open(fin, "rb")