helper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AlphabetNumeric = &RandomString{
		layout: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
		r:      rand.New(rand.NewSource(time.Now().UnixNano())),
		mu:     sync.Mutex{},
	}

	Numeric = &RandomString{
		layout: "0123456789",
		r:      rand.New(rand.NewSource(time.Now().UnixNano())),
		mu:     sync.Mutex{},
	}
)

Functions

func Uniq

func Uniq[T comparable](arr []T) []T

Types

type RandomString

type RandomString struct {
	// contains filtered or unexported fields
}

func (*RandomString) Generate

func (c *RandomString) Generate(n int) []byte

func (*RandomString) Intn

func (c *RandomString) Intn(n int) int

func (*RandomString) Uint32

func (c *RandomString) Uint32() uint32

func (*RandomString) Uint64

func (c *RandomString) Uint64() uint64

Jump to

Keyboard shortcuts

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