crypto_rand

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecureRandomElement

func SecureRandomElement[T any](collection []T) (T, bool)

SecureRandomElement 使用 crypto/rand 从任意切片或数组中安全随机返回一个元素

func SecureRandomInt

func SecureRandomInt(min, max int) int

func SecureRandomSampleUnique

func SecureRandomSampleUnique[T any](collection []T, n int) ([]T, bool)

SecureRandomSampleUnique 从切片中随机选取 n 个 **不重复** 元素

func Urand

func Urand() string

Urand 随机数生成器

Types

This section is empty.

Jump to

Keyboard shortcuts

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