moonbitstack/moonrand/contract does not have a README file

    Rng

    pub(open) trait Rng {
    fn next_u64(Self) -> UInt64
    fn next_u32(Self) -> UInt = _
    fn fill(Self, buf : FixedArray[Byte]) -> Unit = _
    }

    The contract every generator satisfies: produce uniform machine words. The algorithms in subpackages implement the one required method next_u64; the other two are shared defaults. The sampling and distribution functions in moonrand are generic over any Rng.

    Methods take Self by value and keep their state in interior-mutable fields (Array buffers and priv mut scalars), so a draw advances the caller's generator without a mutable reference.

    Secure

    pub(open) trait Secure : Rng {
    }

    A generator fit for cryptography: ChaCha and the like. Philox and PCG pass statistical tests but are not, so they do not carry this marker.

    Seeded

    pub(open) trait Seeded : Rng {
    fn from_seed(BytesView) -> Self
    fn seed_size() -> Int
    }

    A generator rebuilt from a seed, for reproducible runs.

    Source Files

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io