Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Last active December 18, 2019 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/172b5753e38b8f2af9bc62f8f862a949 to your computer and use it in GitHub Desktop.
Save ssaurel/172b5753e38b8f2af9bc62f8f862a949 to your computer and use it in GitHub Desktop.
Block for a Blockchain made in JS on the SSaurel's Blog
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