$process method

void $process(
  1. List<int> chunk,
  2. int start,
  3. int end
)

Processes a chunk of input data

Implementation

void $process(List<int> chunk, int start, int end) {
  int t = start;
  if (pos > 0) {
    for (; t < end && pos < blockLength; pos++, t++) {
      buffer[pos] = chunk[t];
    }
    messageLength += t - start;
    if (pos < blockLength) return;

    $update(buffer);
    pos = 0;
  }

  while ((end - t) >= blockLength) {
    messageLength += blockLength;
    $update(chunk, t);
    t += blockLength;
  }

  messageLength += end - t;
  for (; t < end; pos++, t++) {
    buffer[pos] = chunk[t];
  }
}