GitHunt
AK

akalin/random

An implementation of Lemire's nearly divisionless random number generator

Build Status
GoDoc

This repository contains a Go implementation of Lemire's "Fast Random Integer Generation in an Interval". See also
Lemire's blog post and
this blog post for more details.

The algorithm is Uint32n() in random.go, with tests and benchmarks in random_test.go.

The tests use the testify testing
library, so first install it:

go get -u github.com/stretchr/testify

Then to run the tests, make sure that this repository is in $GOPATH/github.com/akalin/random, and do

go test -v github.com/akalin/random

and to run the benchmarks, do

go test -v github.com/akalin/random -bench .

Languages

Go100.0%

Contributors

Apache License 2.0
Created August 29, 2019
Updated August 30, 2019