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