HalfLongPermutation
Finite long permutation using cycle-walking over a 2^k-sized block.
Embeds the domain [0, size) in a power-of-two block and applies reversible affine steps plus XOR-shift mixing. Outputs outside [0, size) are rejected and walked until they fall back inside the domain.
Parameters
Random generator used to derive per-round keys.
Number of mixing rounds; higher values increase dispersion.
Odd multiplicative constant used in each affine step.
Properties
Functions
Decodes a previously encoded value without range checks.
Encodes a value without range checks.
Returns an iterator over encode(i) for indices in [offset, size).
Returns an iterator over encode(i) for all i in [0, size) for finite domains, or over the full 64-bit space when size == -1L.
Returns a view of this permutation that operates on range instead of [0, size). Only valid for finite domains where range.count() == size.
HalfLongPermutation
Parameters
Random generator used to derive per-round keys.
Number of mixing rounds; higher values increase dispersion.
Odd multiplicative constant used in each affine step.
decodeUnchecked
Decodes a previously encoded value without range checks.
encodeUnchecked
Encodes a value without range checks.
iterator
Returns an iterator over encode(i) for indices in [offset, size).
For finite domains, offset is an index in 0..size. For full-domain implementations, semantics are defined by the implementation.