Skip to content

akalin/random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 .

About

An implementation of Lemire's nearly divisionless random number generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages