add method

  1. @override
void add(
  1. List<int> data, [
  2. int start = 0,
  3. int? end
])
override

Adds data to the message-digest.

Throws StateError, if it is called after closing the digest.

Implementation

@override
void add(List<int> data, [int start = 0, int? end]) {
  if (_closed) {
    throw StateError('The message-digest is already closed');
  }

  end ??= data.length;
  if (messageLength - start > _maxMessageLength - end) {
    throw StateError('Exceeds the maximum message size limit');
  }

  $process(data, start, end);
}