bwtTransform

fnBwtResult bwtTransform(const(ubyte)[] input) pure

Perform the Burrows-Wheeler Transform on the input data.

The BWT works by:

  1. Conceptually creating all rotations of the input.
  2. Sorting these rotations lexicographically.
  3. Outputting the last character of each sorted rotation.
  4. Recording origPtr: the index where the original (unrotated) string

appears in the sorted list.

This implementation uses a combination of radix sort and introsort for efficient suffix array construction.

Parameters

inputThe data to transform.

Returns

BwtResult containing the transformed data and origPtr.