Skip to content

Instantly share code, notes, and snippets.

View skalski's full-sized avatar
🐧
Let's do some stuff

SK skalski

🐧
Let's do some stuff
View GitHub Profile
@skalski
skalski / Blockchain.js
Created March 11, 2021 19:33
BlockChain Startup Code
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;
}