Skip to content

Introduction

Fluky

Happening by or depending on chance in Golang.

Go Reference Go Report Card License

Overview

Fluky Library offers a wide range of methods to generate various types of random values. It relies on the standard rand.Rand located in math/rand and includes several random number generators such as pcg, small prng, splitmix64, xoshiro256++, and xoshiro256**. Also, there are a couple of Positional sources that can be used to generate random values based on the position in the sequence. Please check Squirrel3 family (Youtube) and Sxm family (inspired by xxhash approach). These generators have been evaluated for their quality using the dieharder test suite.

Please check dieharder results in repo.

Install

go get -u github.com/Pencroff/fluky

Usage example

package main

import (
    "fmt"
    "github.com/Pencroff/fluky"
    src "github.com/Pencroff/fluky/source"
    "math/rand"
)

func main() {
    s := src.NewPcgSource(0)
    r := rand.New(s)
    flk := fluky.NewFluky(r)

    fmt.Println(flk.Uint64())
}