splitmix64

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Gamma is the Weyl sequence constant (golden ratio point).
	Gamma = 0x9e3779b97f4a7c15

	// M1 Mixing constants (odd numbers, ensuring coprimality with 2^64).
	M1 = 0xbf58476d1ce4e5b9
	M2 = 0x94d049bb133111eb

	// InvM1 Modular Multiplicative Inverses of the mixing constants.
	// Calculated such that (M * InvM) == 1 (mod 2^64).
	// Used for the Reverse function.
	InvM1 = 0x96de1b173f119089
	InvM2 = 0x319642b2d24d8ec3

	// S1 Shift constants for the XOR-Shift steps.
	S1 = 30
	S2 = 27
	S3 = 31
)

Variables

View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMCompiles,
	WASMJS:           packageprops.WASMCompiles,
	WASMFreestanding: packageprops.WASMCompiles,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.

Functions

func Forward

func Forward(x uint64) uint64

Forward applies the SplitMix64 permutation to x. It maps the input integer to a pseudo-random output unique to x.

func Reverse

func Reverse(z uint64) uint64

Reverse applies the inverse of the SplitMix64 permutation. It guarantees that Reverse(Forward(x)) == x.

Types

This section is empty.

Jump to

Keyboard shortcuts

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