Get your own Node server
const crypto = require('crypto');

// Create a hash object
const hash = crypto.createHash('sha256');

// Update the hash with multiple pieces of data
hash.update('First part of the data.');
hash.update(' Second part of the data.');
hash.update(' Third part of the data.');

// Calculate the final digest
const digest = hash.digest('hex');

console.log('Combined data: First part of the data. Second part of the data. Third part of the data.');
console.log('SHA-256 Hash:', digest);

// You can achieve the same result with a single update
const singleHash = crypto.createHash('sha256');
singleHash.update('First part of the data. Second part of the data. Third part of the data.');
const singleDigest = singleHash.digest('hex');

console.log('Single update hash matches multiple updates?', singleDigest === digest);

              
Combined data: First part of the data. Second part of the data. Third part of the data.
SHA-256 Hash: 1f3ce7f288a2f1a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132
Single update hash matches multiple updates? true