import hmac
import hashlib
myKey = b'tajny_klucz'
digest_maker = hmac.new(myKey, b'', hashlib.sha256)
with open("./test.txt", "w") as hello_file:
    hello_file.write('Cześć')
    hello_file.close()

# Plik test.txt zawiera słowo Cześć
with open('./test.txt', 'rb') as f:
    while True:
        block = f.read(5)
        if not block:
            break

digest_maker.update(block)
digest = digest_maker.hexdigest()
print(digest)

#ad491a525e7723d9a3c623ea61df04651f25f3834df311d50dc28553eee2ae29
