- Published:
- 2025-04-01
RandN v0.5.0 has been released! It's available at NuGet and GitHub. We've dropped .NET 3.1 and .NET 7 support since they've both reached End-of-Life, but also added .NET 8 as a target to take advantage to support the new 128-bit integers.
A uniform distribution has been added for generating arbitrarily large BigIntegers. Uniform distributions have also been added for both Int128 and its unsigned counterpart, UInt128, when targeting .NET 8 and above.
Thanks to steve7411, the ShuffleInPlace extension method is much faster when being executed on Lists and arrays.
RNGs have been broken out into several separate packages. This will allow the extra complexity and targets needed to support SIMD in ChaCha to be isolated from the main RandN package. Non-essential RNGs like XorShift and Mersenne Twister have been moved to the ExtraRngs package to avoid including optional RNGs in the main download.
Support for big-endian CPUs has been removed - as big-endian CPUs are difficult to come by, the code was completely untested. If someone wants to test it out on an s390x and experiment with it, support can be enabled by compiling RandN with ENABLE_BIG_ENDIAN defined.
Full Changelog
- Added .NET 8 target
- (Breaking Change) Dropped .NET Core 3.1 and .NET 7 targets
- Added a Uniform distribution for BigInteger
- Added Uniform distributions for UInt128 and Int128 - these are only available on .NET 8 and later targets.
- Greatly improve performance of ShuffleInPlace on List
and arrays (thanks @Steve7411) - (Breaking Change) Removed Big-Endian support
- Reorganized RNG algorithms into separate packages:
- Moved the PCG 32 RNG into the new
RandN.Pcg32
package and made it a dependency ofRandN
. - Moved the ChaCha RNG into the new
RandN.ChaCha
package and made it a dependency ofRandN
. - (Breaking Change) Moved XorShift and Mersenne Twister into the optional
RandN.ExtraRngs
package
- Moved the PCG 32 RNG into the new
RandN.Core
- Added .NET 8 target
- (Breaking Change) Dropped .NET Core 3.1 and .NET 7 targets
- Fixed failure to use intrinsics for bitwise-operations when available
- (Breaking Change) Removed Big-Endian support
RandN.ExtraRngs
- Initial release
- Includes the Mersenne Twister variant MT19937-64 and a Xor Shift variant
RandN.ChaCha
- Initial release
- Includes both software and vectorized implementations of the ChaCha CSPRNG algorithm.
RandN.Pcg32
- Initial release
- Includes an implementation of the PCG 32 PRNG algorithm.
What's next?
This is likely the last version of RandN to support .NET 6, as it is now End-of-Life.
Keep an eye on the issue tracker for future plans.