Releases: nvzqz/RandomKit
Releases · nvzqz/RandomKit
v4.4.0
New Features
- Added initializers to
ReseedingRandomGeneratorthat take 1 or 0 arguments - Added floating-point value generation methods for open, half open, and closed intervals (see 59182e5)
- Added thread-local random generators (see fde214b) 🎉
Improvements
- Made
DoubleandFloatrandom(using:)about 27 times faster (see 8799af7) - Made
CGFloat.random(using:)faster , in turn making(NS|UI)Color.random(using:)faster (see a1b60d1)
Fixes
- Made
randomClosedmethods be truly on the [0, 1] interval (see 9b0d56b)
v4.3.1
v4.3.0
New Features
- Added
SeedableFromOtherRandomGeneratorprotocol- Allows for creating a
RandomGeneratorseeded from anotherRandomGenerator
- Allows for creating a
- Added
ReseedingRandomGeneratorstruct for reseeding a baseRandomGeneratorwith another after a certain number of bytes have been generated
Improvements
- Much faster Array
random(using:)for Swift versions before 3.1
Fixes
- Fix compilation issues by not using API unavailable in Swift 3.1
v4.2.0
Improvements
-
Made Array
init(randomCount:using:)about 4 times faster for integer types by having it safely callinit(unsafeRandomCount:using:)(see 350ce9d) -
Made Dictionary shuffling faster (see 1977f86)
Changes
- Made Array
init(unsafeRandomCount:using:)available for all element types, regardless if they conform toUnsafeRandom(see 71d4bc6)
v4.1.0
v4.0.0
New Features
- Added
randoms(using:)methods toRandom-types that return a sequence of random values according to the protocol's specialization - Added
Bool.random(withWeight:using:)for probability - Added more random number generators:
XorshiftXorshiftStar
NSMutableArraynow conforms toShuffleableandUniqueShuffleable- Added
randomTuple(using:)global functions for creating tuples of up to six random elements - Added
ShuffleableInRangeandUniqueShuffleableInRangeprotocols
Improvements
- Much better
init(randomCount:using:)performance forArrayandDictionary Arrayshuffling is ten times faster- Much better performance for
random(within:using:)for signed integers
Changes
- Changed
RandomGeneratorfrom an enum to a protocol type- As a result, there is no default generator, meaning a generator must be specified as a parameter
- Random generation functions take a generic
RandomGeneratortype as aninoutargument - Removed
URLconformance toRandom
v3.0.0
New Features
- Mersenne Twister random generator
- All integer types conform to
UnsafeRandom Array(unsafeRandomCount:using:)for types conforming toUnsafeRandom- For much better performance with integer types, this should be used
- Added a benchmark target that can be built with the Swift package manager
- Created
RandomWithMaxWidthandRandomWithExactWidthprotocols - Added
randomize(buffer:maxWidth:)andrandomize(buffer:exactWidth:)methods toRandomGenerator
Improvements
- Generating
RandomEnumvalues is significantly faster
Fixes
UnicodeScalarnow produces a uniform distribution when theRangeorClosedRangespans below0xD7FFand above0xE000
Changes
- Removed
RandomDistribution(#29) - The
devRandomanddevURandomcases forRandomGeneratorare now a singledevicecase with aDeviceSourceparameter - The
arc4randomcase forRandomGeneratoris now camel-casedarc4Random Float80extension now available for i386 and x86_64 architectures, not only for macOSURL.random(fromValues:)now returns anOptional<URL>- Added ShiftOperations dependency
- Uses
Strideableinstead of_Strideable
v2.3.0
New Features
Datenow conforms toRandomWithinRange- Made unicode scalar based string generation faster
- Created
UnsafeRandom,RandomEnum,RandomWithAll, andRandomRawRepresentableprotocols
Fixes
- Fix which random generator is used for random String. Previously used the default instead of the one passed into the function.
v2.2.1
v2.2.0
Fixes
- Random
Intgeneration would rely on the size ofUIntMaxwhich was apparently not reliable (#28)
Changes
- If on Linux, Android, or Windows, the
arc4random_buffunction will be dynamically loaded, making theRandomGenerator.arc4randomoption more widely available - Removed default parameter for
randomGeneratorfor therandom(using:)function ofRangetypes - Removed
Randomprotocol dependency fromRandom-protocols