hash_file01.py

# =========================================================
#
# =========================================================

import hashlib

h = hashlib.sha256()

fn = 'ludlow.png'

f = open(fn,'rb')
while True:
    buf = f.read(128)
    print('buf len is {}'.format(len(buf)))
    if not buf:
        break
    h.update(buf)
f.close()

print(h.hexdigest())
print(h.digest_size)
print(h.block_size)