id

package
v0.0.0-...-1569ab3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultShortNameLen is defult length of short name
	DefaultShortNameLen = 8
)

Variables

This section is empty.

Functions

func BaseUUID

func BaseUUID() string

BaseUUID generate uuid by base64 encoding

func BytesUUID

func BytesUUID() []byte

BytesUUID generate google/uuid as string

func HexUUID

func HexUUID(upper bool) string

HexUUID generate uuid by hex encoding

func ShortID

func ShortID(n int) string

ShortID generate a random string with length n.

func ShortIDWithDic

func ShortIDWithDic(n int, dic string, headDicLen int) (string, error)

ShortIDWithDic generate a shortID with dictionary.

func ShortIDWithError

func ShortIDWithError(n int) (string, error)

ShortIDWithError generate a random string with length n

func StringUUID

func StringUUID() string

StringUUID generate google/uuid as string

func UpperShortID

func UpperShortID(n int) string

UpperShortID generate a random string with length n.

func WithPrefix

func WithPrefix(id string, prefix string) string

WithPrefix add prefix to id if prefix is not empty

Types

This section is empty.

Jump to

Keyboard shortcuts

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