sdrand

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sdrand 随机工具扩展

Index

Constants

This section is empty.

Variables

View Source
var (
	LowerCaseLettersCharset      = lo.LowerCaseLettersCharset
	UpperCaseLettersCharset      = lo.UpperCaseLettersCharset
	LettersCharset               = lo.LettersCharset
	NumbersCharset               = lo.NumbersCharset
	AlphanumericCharset          = lo.AlphanumericCharset
	LowerCaseAlphanumericCharset = append(LowerCaseLettersCharset, NumbersCharset...)
	UpperCaseAlphanumericCharset = append(UpperCaseLettersCharset, NumbersCharset...)
	SpecialCharset               = lo.SpecialCharset
	AllCharset                   = lo.AllCharset
)

Functions

func Bytes

func Bytes(n int) sdbytes.Slice

func Float64Between

func Float64Between(low, high float64) float64

func Int64Between

func Int64Between(low, high int64) int64

func IntBetween

func IntBetween(low, high int) int

func Sample

func Sample[T any](collections ...T) T

func SampleWeighted

func SampleWeighted[T any](collections ...W[T]) T

func Samples

func Samples[T any](collections []T, n int) []T

func Shuffle

func Shuffle[T any](collection []T)

func ShuffleClone

func ShuffleClone[T any](collection []T) []T

func String

func String(n int, set []rune) string

Types

type W

type W[T any] struct {
	W int `json:"w"`
	V T   `json:"v"`
}

Jump to

Keyboard shortcuts

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