Skip to content

Instantly share code, notes, and snippets.

View viet-quocnguyen's full-sized avatar

Viet Nguyen viet-quocnguyen

View GitHub Profile
const hash = require("crypto-js/sha256");
class Block {
constructor(previousHash, data) {
this.data = data;
this.hash = this.calculateHash();
this.previousHash = previousHash;
this.timeStamp = new Date();
this.proofOfWork = 0;
}