Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def calculate_hash(self):
  2. payload = "{}{}{}{}{}".format(self.index,
  3. self.previous_hash,
  4. self.timestamp,
  5. json.dumps(self.payload),
  6. self.nonce).encode('utf-8')
  7.  
  8. return hashlib.sha256(payload).hexdigest()
Add Comment
Please, Sign In to add comment