update method

  1. @override
Hash update(
  1. List<int> data
)
override

Updates the hash computation with the given data.

This method updates the hash computation with the provided data bytes. It appends the data to the internal buffer and processes it to update the hash state.

If the hash has already been finished using the finish method, calling this method will result in an error.

Parameters:

  • data: The List

Returns this Hash object for method chaining.

Implementation

@override
Hash update(List<int> data) {
  if (_finished) {
    throw const MessageException(
        "SHA512: can't update because hash was finished.");
  }
  _lengthInBytes += data.length;
  _buffer.addAll(BytesUtils.toBytes(data));
  _iterate();
  return this;
}