Repository

codebasics/py

Repository to store sample python programs for python learning
5471 13935 330 62
  • 000
import hashlib def hashGenerator(data): result=hashlib.sha256(data.encode()) return result.hexdigest() class Block: def init(self,data,hash,prev_hash): self.data=data self.hash=hash self.prev_hash=prev_hash class Blockchain: def init(self): hashLast=hashGenerator('gen_last') hashStart=hashGenerator(...