SunamoRandom¶
Generate random objects and values
- NuGet: $(@{Name=SunamoRandom; CsprojRel=SunamoRandom/SunamoRandom/SunamoRandom.csproj; ReadmePath=/home/runner/work/PlatformIndependentNuGetPackages/PlatformIndependentNuGetPackages/SunamoRandom/README.md; Description=Generate random objects and values; ApiNamespace=SunamoRandom}.Name)
- Source: GitHub
- API reference: ../../api/SunamoRandom.html
A lightweight .NET library for generating random values of various types including integers, floats, bytes, strings, booleans, DateTimes, and enum values.
Overview¶
SunamoRandom is part of the Sunamo package ecosystem, providing modular, platform-independent utilities for .NET development.
Main Components¶
Key Classes¶
- RandomHelper - Core static class with methods for generating random primitives, strings, and collection elements
- RandomHelperList - Generates lists of random numbers with specified digit lengths
- RandomStringHelper - Generates random strings with configurable alphanumeric and special character composition
Key Methods¶
RandomInt(),RandomInt2()- Random integers with various bound optionsRandomFloat()- Random floats with configurable precisionRandomByte(),RandomBytes()- Random bytes and byte arraysRandomString(),RandomStringWithoutSpecial()- Random strings with character type controlRandomBool()- Random boolean valuesRandomDateTime()- Random DateTime valuesRandomEnum<T>()- Random enum valuesRandomElementOfCollectionT<T>()- Random element from a typed collectionRandomColorPart()- Random color component bytes
Installation¶
Target Frameworks¶
net10.0, net9.0, net8.0
Dependencies¶
- Microsoft.Extensions.Logging.Abstractions
License¶
MIT