Releases: nvzqz/RandomKit
Releases · nvzqz/RandomKit
v4.4.0
New Features
- Added initializers to
ReseedingRandomGenerator
that 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
Double
andFloat
random(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
randomClosed
methods be truly on the [0, 1] interval (see 9b0d56b)
v4.3.1
v4.3.0
New Features
- Added
SeedableFromOtherRandomGenerator
protocol- Allows for creating a
RandomGenerator
seeded from anotherRandomGenerator
- Allows for creating a
- Added
ReseedingRandomGenerator
struct for reseeding a baseRandomGenerator
with 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:
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
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
RandomWithMaxWidth
andRandomWithExactWidth
protocols - Added
randomize(buffer:maxWidth:)
andrandomize(buffer:exactWidth:)
methods toRandomGenerator
Improvements
- Generating
RandomEnum
values is significantly faster
Fixes
UnicodeScalar
now produces a uniform distribution when theRange
orClosedRange
spans below0xD7FF
and above0xE000
Changes
- Removed
RandomDistribution
(#29) - The
devRandom
anddevURandom
cases forRandomGenerator
are now a singledevice
case with aDeviceSource
parameter - The
arc4random
case forRandomGenerator
is now camel-casedarc4Random
Float80
extension now available for i386 and x86_64 architectures, not only for macOSURL.random(fromValues:)
now returns anOptional<URL>
- Added ShiftOperations dependency
- Uses
Strideable
instead of_Strideable
v2.3.0
New Features
Date
now conforms toRandomWithinRange
- Made unicode scalar based string generation faster
- Created
UnsafeRandom
,RandomEnum
,RandomWithAll
, andRandomRawRepresentable
protocols
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
Int
generation would rely on the size ofUIntMax
which was apparently not reliable (#28)
Changes
- If on Linux, Android, or Windows, the
arc4random_buf
function will be dynamically loaded, making theRandomGenerator.arc4random
option more widely available - Removed default parameter for
randomGenerator
for therandom(using:)
function ofRange
types - Removed
Random
protocol dependency fromRandom-
protocols