Created
December 18, 2019 13:03
-
-
Save ssaurel/ddce504bbba685200660f3ef3b0ba316 to your computer and use it in GitHub Desktop.
CalculateHash function for a Blockchain in JS on the SSaurel's Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateHash(block) { | |
return sha256(block.index + block.previousHash + | |
block.timestamp + block.data + | |
block.nonce); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment