I'm trying to write a code that will calculate 1000 SHA256 hashes from 3 randomly generated numbers( x1,x2,x3) Ideally it should be in the loop from 1 to 1000 and all i need is to store the values somewhere in a list or array and analyze them later. When i'm running the code below, even though the random numbers are changing evry time, print(digest.finalize()) always returns the same hash
import random
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
while i<1000:
digest = hashes.Hash(hashes.SHA256(), backend=default_backend())
x1=random.randrange(2,256)
x2=random.randrange(2,256)
x3=random.randrange(2,256)
print("x1,x2,x3 are ",x1,x2,x3)
digest.update(b'x1')
digest.update(b'x2')
digest.update(b'x3')
print(digest.finalize())
del digest
#print(digest.finalize())
i=i+1