Criando o método de hashblock usando o algoritmo SHA256 Hashing
Blockchain.prototype.hashBlock = function(prevBlockHash, currentBlockData, nonce) {
const dataString = prevBlockHash + nonce.toString() + JSON.stringify(currentBlockData);
const hash = sha256(dataString);
return hash;
}
Outrageous Ostrich