Help us shape the future of Go! Take the 2026 Go Developer Survey

fastprng

package module
v0.0.0-...-b46f877 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: MIT Imports: 2 Imported by: 0

README

fastprng

Implementation of the MARC and MaD0 Ultrafast High Quality Non-Cryptographic Pseudorandom Number Generator in Golang

WARNING This is not a full implementation yet. Basic MARC seems to work, but it hasn't been tested against reference test values.

Implementing MARC-bb (MARC as a building block), and then mad0 are next steps.

See the paper by Jie Li for the details on mad0 and MARC: http://dl.acm.org/citation.cfm?id=2875131.2856693

Documentation

Index

Constants

View Source
const Tlen = 512

Variables

This section is empty.

Functions

This section is empty.

Types

type MARCRandSource

type MARCRandSource struct {
	S []uint8
	// contains filtered or unexported fields
}

func NewMARC

func NewMARC(seed int64) *MARCRandSource

func NewMARCBB

func NewMARCBB(seed int64) *MARCRandSource

func (*MARCRandSource) Int63

func (r *MARCRandSource) Int63() int64

func (*MARCRandSource) KSA

func (z *MARCRandSource) KSA(key []uint8)

func (*MARCRandSource) Next

func (r *MARCRandSource) Next() uint32

func (*MARCRandSource) PRGA_iteration

func (z *MARCRandSource) PRGA_iteration() []uint8

func (*MARCRandSource) Seed

func (r *MARCRandSource) Seed(seed int64)

func (*MARCRandSource) SeedMARCBB

func (r *MARCRandSource) SeedMARCBB(seed int64)

func (*MARCRandSource) SeedWithIterationCount

func (r *MARCRandSource) SeedWithIterationCount(seed int64, ks_iterations uint16)

func (*MARCRandSource) UInt64

func (r *MARCRandSource) UInt64() uint64

type MaD0Source

type MaD0Source struct {
	S []uint64

	T []uint64
	// contains filtered or unexported fields
}

func NewMaD0

func NewMaD0(seed int64) *MaD0Source

func (*MaD0Source) Generate

func (r *MaD0Source) Generate()

func (*MaD0Source) Int63

func (r *MaD0Source) Int63() int64

func (*MaD0Source) Next

func (r *MaD0Source) Next() uint64

func (*MaD0Source) Seed

func (mad *MaD0Source) Seed(seed int64)

func (*MaD0Source) UInt64

func (r *MaD0Source) UInt64() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL