MCPcopy
hub / github.com/lhartikk/naivechain / calculateHashForBlock

Function calculateHashForBlock

main.js:108–110  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

106
107
108var calculateHashForBlock = (block) => {
109 return calculateHash(block.index, block.previousHash, block.timestamp, block.data);
110};
111
112var calculateHash = (index, previousHash, timestamp, data) => {
113 return CryptoJS.SHA256(index + previousHash + timestamp + data).toString();

Callers 1

isValidNewBlockFunction · 0.85

Calls 1

calculateHashFunction · 0.85

Tested by

no test coverage detected