hashNode
Creates a hash for a value using the SHA-256 algorithm. Returns a promise.
- Use
crypto.createHash()to create aHashobject with the appropriate algorithm. - Use
hash.update()to add the data fromvalto theHash,hash.digest()to calculate the digest of the data. - Use
setTimeout()to prevent blocking on a long operation, and return aPromiseto give it a familiar interface.