RandomKit v4.0.0 Release Notes
Release Date: 2017-03-06 // about 7 years ago-
๐ 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:
Xorshift
XorshiftStar
NSMutableArray
now conforms toShuffleable
andUniqueShuffleable
- โ Added
randomTuple(using:)
global functions for creating tuples of up to six random elements - โ Added
ShuffleableInRange
andUniqueShuffleableInRange
protocols
๐ Improvements
- ๐ Much better
init(randomCount:using:)
performance forArray
andDictionary
Array
shuffling is ten times faster- ๐ Much better performance for
random(within:using:)
for signed integers
๐ Changes
- ๐ Changed
RandomGenerator
from 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
RandomGenerator
type as aninout
argument - โ Removed
URL
conformance toRandom
- โ Added