token

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var X gen

Functions

func FormatUUID

func FormatUUID(buf []byte) (string, error)

func GenerateRandomBytes

func GenerateRandomBytes(size int) ([]byte, error)

GenerateRandomBytes is used to generate random bytes of given size.

func GenerateUUID

func GenerateUUID() (string, error)

GenerateUUID is used to generate a random UUID

func GetMD5Base64

func GetMD5Base64(bytes []byte) (base64Value string)

func GetMd5String

func GetMd5String(s string) string

func GetUUID

func GetUUID() (uuidHex string)

func New

func New() string

Simple call

func NextStrToken

func NextStrToken() string

func NextToken

func NextToken() int64

func ParseUUID

func ParseUUID(uuid string) ([]byte, error)

func RandStringBytes

func RandStringBytes(n int) string

func UniqueId

func UniqueId() string

Types

type ID

type ID struct {
	S       string
	Machine string
	PID     uint16
	Counter int32
}

type IdWorker

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

func (*IdWorker) InitIdWorker

func (this *IdWorker) InitIdWorker(workerId, datacenterId int64) error

func (*IdWorker) NextId

func (this *IdWorker) NextId() (int64, error)

type UUID

type UUID [16]byte

func NewUUID

func NewUUID() UUID

func (UUID) String

func (u UUID) String() string

Jump to

Keyboard shortcuts

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