Skip to content

Instantly share code, notes, and snippets.

@leightkt
Created April 9, 2021 20:15
Show Gist options
  • Save leightkt/e181a80ea5a15d917f38545d7e35c02d to your computer and use it in GitHub Desktop.
Save leightkt/e181a80ea5a15d917f38545d7e35c02d to your computer and use it in GitHub Desktop.
class Block {
constructor(index, timestamp, data, previousHash = '', nonce = 0) {
this.index = index
this.timestamp = timestamp
this.data = data
this.previousHash = previousHash
this.hash = this.calculateHash()
this.nonce = nonce
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment