util

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GUID

func GUID() string

func HashString

func HashString(str string) string

func IsGroupUID added in v0.0.5

func IsGroupUID(uid string) bool

func Min

func Min[T Integer](a, b T) T

func RandIntn

func RandIntn(n int) int

RandIntn returns a random number in [0, n).

func Sha256

func Sha256(data []byte) []byte

func UUID

func UUID() string

UUID returns a short version of UUID v4.

Types

type Integer added in v0.0.5

type Integer interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Set added in v0.0.5

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet added in v0.0.5

func NewSet[T comparable]() *Set[T]

func (*Set[T]) Add added in v0.0.5

func (s *Set[T]) Add(elem ...T) *Set[T]

func (*Set[T]) Contains added in v0.0.5

func (s *Set[T]) Contains(elem T) bool

func (*Set[T]) Remove added in v0.0.5

func (s *Set[T]) Remove(elem ...T) *Set[T]

Directories

Path Synopsis
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package snowflake provides a very simple Twitter snowflake generator and parser.

Jump to

Keyboard shortcuts

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