compareRotations

private fnint compareRotations(const(ubyte)[] block, size_t i, size_t j) pure nothrow @nogc

Compare two rotations of the input block lexicographically.

This function compares the rotation starting at index i with the rotation starting at index j. Rotations wrap around the end of the block.

Parameters

blockThe input data block.
iStarting index of first rotation.
jStarting index of second rotation.

Returns

Negative if rotation[i] < rotation[j],

zero if equal, positive if rotation[i] > rotation[j].