StatelessRandomGetKeyCounter

public final class StatelessRandomGetKeyCounter

Scrambles seed into key and counter, using the best algorithm based on device.

This op scrambles a shape-[2] seed into a key and a counter, both needed by counter-based RNG algorithms. The scrambing uses the best algorithm based on device. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers).

Public Methods

Output<?>
counter()
Counter for the counter-based RNG algorithm.
static <T extends Number> StatelessRandomGetKeyCounter
create(Scope scope, Operand<T> seed)
Factory method to create a class wrapping a new StatelessRandomGetKeyCounter operation.
Output<?>
key()
Key for the counter-based RNG algorithm (shape uint64[1]).

Inherited Methods

Public Methods

public Output<?> counter ()

Counter for the counter-based RNG algorithm. Since counter size is algorithm-dependent, this output will be right-padded with zeros to reach shape uint64[2] (the current maximal counter size among algorithms).

public static StatelessRandomGetKeyCounter create (Scope scope, Operand<T> seed)

Factory method to create a class wrapping a new StatelessRandomGetKeyCounter operation.

Parameters
scope current scope
seed 2 seeds (shape [2]).
Returns
  • a new instance of StatelessRandomGetKeyCounter

public Output<?> key ()

Key for the counter-based RNG algorithm (shape uint64[1]).