Skip to content

Fast random number generator in pure Swift

License

Notifications You must be signed in to change notification settings

yonilevy/SwiftWyhash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftWyhash

Build Status

This is Swift port of pseudorandom number generator wyrand from wyhash by Wang Yi. On 64-bit hardware, it is should be effectively faster than any other commonly available random number generator. It meets quality standards: it passes Big Crunch.

It conforms to RandomNumberGenerator protocol.

Usage:

var gen = WyRand(seed: 42)
gen.next() // generates a 64-bit random number

(1...10).shuffled(using: &gen)

For a benchmark, see SwiftWyhashBenchmark.

Further reading: The fastest conventional random number generator that can pass Big Crush?

About

Fast random number generator in pure Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%