hash.digest([encoding])
计算传给被哈希的所有数据的摘要(使用 hash.update()
方法)。如果提供了 encoding
,将返回一个字符串;否则返回 Buffer
。
¥Calculates the digest of all of the data passed to be hashed (using the
hash.update()
method).
If encoding
is provided a string will be returned; otherwise
a Buffer
is returned.
Hash
对象在调用 hash.digest()
方法后不能再次使用。多次调用将导致抛出错误。
¥The Hash
object can not be used again after hash.digest()
method has been
called. Multiple calls will cause an error to be thrown.