findGreedySequences

private fnLz4Sequence[] findGreedySequences(const(ubyte)[] src, uint hashBits)

Find sequences using a greedy match-finding algorithm.

This implements the core LZ4 greedy compression strategy:

  • For each position, compute a hash of the next 4 bytes
  • Look up the hash in the table to find a candidate match position
  • If a valid match is found (≥4 bytes, within offset range), emit it
  • Otherwise, accumulate the byte as a literal
  • Update the hash table with the current position

The algorithm ensures the last LZ4_MIN_MATCH bytes are emitted as literals (LZ4 format requirement for safe decoding).

Parameters

srcInput data to compress.
hashBitsNumber of hash bits for the table (determines table size).

Returns

An array of Lz4Sequence structs describing the compressed

representation. The final sequence will have matchLen == 0.