Skip to main content
method Cipher.prototype.update
Cipher.prototype.update(data: BinaryLike): Buffer
Deprecated

Updates the cipher with data. If the inputEncoding argument is given, the dataargument is a string using the specified encoding. If the inputEncodingargument is not given, data must be a Buffer, TypedArray, or DataView. If data is a Buffer, TypedArray, or DataView, then inputEncoding is ignored.

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

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

Parameters

Return Type

Buffer
Cipher.prototype.update(
data: string,
inputEncoding: Encoding,
): Buffer
Deprecated

Parameters

data: string
inputEncoding: Encoding

Return Type

Buffer
Cipher.prototype.update(
data: ArrayBufferView,
inputEncoding: undefined,
outputEncoding: Encoding,
): string
Deprecated

Parameters

data: ArrayBufferView
inputEncoding: undefined
outputEncoding: Encoding

Return Type

string
Cipher.prototype.update(
data: string,
inputEncoding: Encoding | undefined,
outputEncoding: Encoding,
): string
Deprecated

Parameters

data: string
inputEncoding: Encoding | undefined
outputEncoding: Encoding

Return Type

string
Back to top