randutil

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package randutil provides cryptographically secure random number utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64

func Float64() float64

Float64 returns a cryptographically random number in [0, 1).

func Int64N

func Int64N(n int64) int64

Int64N returns a cryptographically random integer in [0, n). It panics when n is not positive or the system random source fails.

func IntN

func IntN(n int) int

IntN returns a cryptographically random integer in [0, n). It panics when n is not positive or the system random source fails.

func Shuffle

func Shuffle(n int, swap func(i, j int))

Shuffle pseudo-randomizes the order of n elements using Fisher-Yates. It panics if n is negative or the system random source fails.

func Uint64

func Uint64() uint64

Uint64 returns a cryptographically random uint64. It panics if the system random source fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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