Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
Let's do some stuff

Swen Kalski skalski

🐧
Let's do some stuff
View GitHub Profile
@skalski
skalski / Blockchain.js
Created Mar 11, 2021
BlockChain Startup Code
View Blockchain.js
const SHA256 = require("crypto-js/sha256");
class CryptoBlock {
constructor(index, timestamp, data, precedingHash = " ") {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.precedingHash = precedingHash;
this.hash = this.computeHash();
this.nonce = 0;
}