Last active
December 18, 2019 13:18
-
-
Save ssaurel/172b5753e38b8f2af9bc62f8f862a949 to your computer and use it in GitHub Desktop.
Block for a Blockchain made 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
class Block { | |
constructor(index, previousHash, timestamp, data) { | |
this.index = index; | |
this.previousHash = previousHash; | |
this.timestamp = timestamp; | |
this.data = data; | |
this.nonce = 0; | |
this.hash = calculateHash(this); // defined later | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment