Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

creating hashblock method using sha256 hashing algorithm

Blockchain.prototype.hashBlock = function(prevBlockHash, currentBlockData, nonce) {
    const dataString  = prevBlockHash + nonce.toString() + JSON.stringify(currentBlockData);
    const hash = sha256(dataString);

    return hash;
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #creating #hashblock #method #hashing #algorithm
ADD COMMENT
Topic
Name
3+1 =