absorb method

void absorb(
  1. Uint8List input
)

Absorbs data into the state. Can be called multiple times before finalizing.

Implementation

void absorb(Uint8List input) {
  if (_squeezing) {
    throw StateError(
        "No se puede absorber después de comenzar el 'squeeze'.");
  }

  int offset = 0;
  while (offset < input.length) {
    int toCopy = _rate - _bufferPos;
    if (toCopy > input.length - offset) {
      toCopy = input.length - offset;
    }
    _buffer.setRange(_bufferPos, _bufferPos + toCopy, input, offset);
    _bufferPos += toCopy;
    offset += toCopy;

    if (_bufferPos == _rate) {
      _absorbBlock(_buffer);
      _bufferPos = 0;
    }
  }
}