From 0bd6410ea3b2b76eeafaa52c0fa626b4477190e2 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Tue, 25 Nov 2025 03:59:18 +0900 Subject: [PATCH] examples/demo: Set the RNG to xoshiro256 The example should run on any target, not just first class ones. --- examples/demo/demo.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 161d48acb..1ea06d096 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -11,6 +11,7 @@ import "core:reflect" import "base:runtime" import "base:intrinsics" import "core:math/big" +import "core:math/rand" /* Odin is a general-purpose programming language with distinct typing built @@ -2258,6 +2259,10 @@ arbitrary_precision_mathematics :: proc() { a, b, c, d, e, f, res := &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{} defer big.destroy(a, b, c, d, e, f, res) + // Set the context RNG to something that does not require + // cryptographic entropy (not supported on all targets). + context.random_generator = rand.xoshiro256_random_generator() + // How many bits should the random prime be? bits := 64 // Number of Rabin-Miller trials, -1 for automatic.