calculateHash() { return SHA256( this.index + JSON.stringify(this.data) + this.previousHash + this.timestamp + this.nonce ).toString(); }
calculateHash() { this.nonce return SHA256( this.previousHash + this.timestamp + JSON.stringify(this.transactions) + this.nonce ).toString() }
static hash(data){ return SHA256(JSON.stringify(data)).toString(); }
function getBlockByHeight(blockHeight) { var txCount = utils.seededRandomIntBetween(blockHeight, 1, 20); var txids = []; for (var i = 0; i < txCount; i++) { txids.push(SHA256("" + blockHeight + "_" + i)); } return new Promise(function(resolve, reject) { resolve({ "hash": SHA256("" + blockHeight), "confirmations": currentBlockHeight - blockHeight, "strippedsize": 56098, "size": 65384, "weight": 233678, "height": blockHeight, "version": 536870912, "versionHex": "20000000", "merkleroot": "567a3d773b07372179ad651edc02776f851020af69b7375a68ad89557dcbff5b", "tx": txids, "time": 1529848136, "mediantime": 1529846560, "nonce": 3615953854, "bits": "17376f56", "difficulty": "5077499034879.017", "chainwork": SHA256("xyz" + blockHeight), "previousblockhash": SHA256("" + (blockHeight - 1)), "nextblockhash": SHA256("" + (blockHeight + 1)) }); }); }
calculateHash() { return SHA256(this.index + this.priviousHash + this.timestamp + JSON.stringify(this.data) + this.nonce).toString(); }
const hash = str => { return SHA256(`${APP_SECRET}${str}${APP_SECRET}`).toString(); }
calculateHash() { return SHA256(this.index + this.previousHash + this.timestamp + this.data.toString() + this.nonce).toString(); }
calculateHash() { return SHA256(this.index + this.previousHash + this.timestamp + JSON.stringify(this.data) + this.nonce ).toString() }
static hash (data) { return SHA256(JSON.stringify(data)).toString() }