Disponible
amalgame-random
PCG-32 + entropie crypto-grade.
Vue d'ensemble
Deux APIs : Random (PCG-32, déterministe avec seed) pour simulations et tests, et CryptoRandom (lecture de /dev/urandom sur Unix, BCryptGenRandom sur Windows) pour tout ce qui a besoin d'aléa non-prédictible.
Caractéristiques
- ✓
Random: PCG-32, déterministe viaSeed(n) - ✓
CryptoRandom: entropie OS pour secrets/IDs - ✓
Int,Float01,Bytes(n),Choice(list) - ✓
ShuffleFisher-Yates in-place - ✓Pure Amalgame (sauf l'appel système d'entropie)
Exemple
Exemple minimal d'utilisation — recopiable tel quel après l'install.
amc package add random let r = Random.Seed(42) let rolls = [r.IntRange(1, 6) for _ in 0..10] let id = CryptoRandom.Hex(16) // 256 bits d'entropie OS
En bref
- Licence : Apache-2.0
- Installation :
amc package add random - Code source : amalgame-lang/amalgame-random
- Index officiel : amalgame-lang/packages-index