Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Last active August 27, 2026 17:30
Show Gist options
  • Select an option

  • Save ssaurel/172b5753e38b8f2af9bc62f8f862a949 to your computer and use it in GitHub Desktop.

Select an option

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
}
}
@Sornwarinsonsiri31

Copy link
Copy Markdown

Uploading IMG_1775488877033.jpg…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment