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


使用新数据更新解密。如果给出inputEncoding参数,它的值必须是'latin1', 'base64''hex'中的一个, data参数是使用指定编码的字符串。如果未给出inputEncoding参数,则data必须是Buffer。如果dataBuffer,则忽略inputEncoding

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

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

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.

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.

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.