decipher.update(data[, inputEncoding][, outputEncoding])


data 更新解密。如果给定了 inputEncoding 参数,则 data 参数是使用指定编码的字符串。如果未给定 inputEncoding 参数,则 data 必须是 Buffer。如果 dataBuffer,则忽略 inputEncoding

¥Updates the decipher with data. If the inputEncoding argument is given, the data argument is a string using the specified encoding. If the inputEncoding argument is not given, data must be a Buffer. If data is a Buffer then inputEncoding is ignored.

outputEncoding 指定加密数据的输出格式。如果指定了 outputEncoding,则返回使用指定编码的字符串。如果未提供 outputEncoding,则返回 Buffer

¥The outputEncoding specifies the output format of the enciphered data. If the outputEncoding is specified, a string using the specified encoding is returned. If no outputEncoding is provided, a Buffer is returned.

可以使用新数据多次调用 decipher.update() 方法,直到调用 decipher.final()。在 decipher.final() 之后调用 decipher.update() 将导致抛出错误。

¥The decipher.update() method can be called multiple times with new data until decipher.final() is called. Calling decipher.update() after decipher.final() will result in an error being thrown.

即使底层密码实现了身份验证,从此函数返回的明文的真实性和完整性此时可能不确定。对于经过身份验证的加密算法,通常仅在应用调用 decipher.final() 时才建立真实性。

¥Even if the underlying cipher implements authentication, the authenticity and integrity of the plaintext returned from this function may be uncertain at this time. For authenticated encryption algorithms, authenticity is generally only established when the application calls decipher.final().