satwikkansal / python_blockchain_app

A fully functional blockchain application implemented in Python from scratch (with tutorial).
819 stars 471 forks source link

How can we generate desired hash code ? #45

Closed ramasai-badam closed 4 years ago

ramasai-badam commented 4 years ago

You have mentioned in proof_of_work function that we have to generate hash code until it satisfies our difficulty criteria. But how can we generate different hash codes when hash code for a string remains same no matter how many times we run the algorithm ?

satwikkansal commented 4 years ago

The string also contains "nonce" which keeps changing.