Faultline API Reference

All Types / Faultline.Interception

class SimRandomHooks

public static class SimRandomHooks

Interception targets for BCL randomness and GUID generation APIs.

Methods

public static Random GetSharedRandom()

Replacement for Random.Shared. Routes to the active simulation PRNG when inside a simulation, or falls back to Random.Shared outside.

public static Random CreateRandom()

Replacement for parameterless new Random(). Forks a deterministic SimRandom when inside a simulation, or creates a real Random outside.

public static Guid NewGuid()
public static Guid CreateVersion7()
public static Guid CreateVersion7(DateTimeOffset timestamp)
public static int NextInt()
public static int NextInt(int maxValue)
public static int NextInt(int minValue, int maxValue)
public static double NextDouble()
public static void NextBytes(Span<byte> buffer)
public static void FillCryptoBytes(Span<byte> data)
public static byte[] GetCryptoBytes(int count)