xxid

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uuid

func Uuid()

Types

type Guid

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

func NewGuid

func NewGuid() *Guid

func NewGuidFromBytes

func NewGuidFromBytes(uuidbytes []byte) (Guid, error)

func NewGuidFromStr

func NewGuidFromStr(uuidstr string) (guid Guid, e error)

从16进制字符串的uuid还原为其对象

func NewGuidWithGoogle added in v0.0.9

func NewGuidWithGoogle(uid uuid.UUID) *Guid

func NewGuidWithSeed

func NewGuidWithSeed(seedId []byte) *Guid

func (*Guid) Bytes

func (this *Guid) Bytes() []byte

func (*Guid) IdStr

func (this *Guid) IdStr() string

返回 36位格式化字符串: dbf08796-25ff-426f-8fd4-a0b995fb4036

func (*Guid) NextGuid

func (this *Guid) NextGuid() (*Guid, error)

func (*Guid) NextGuidByte

func (this *Guid) NextGuidByte() ([]byte, error)

func (*Guid) NextGuidStr

func (this *Guid) NextGuidStr() (string, error)

func (*Guid) Passwd

func (this *Guid) Passwd(passwd string) (string, error)

使用这种方式生成的密码,同一个明文密码,但是每一个设备都是不一样唯一的.

func (Guid) Raw added in v0.0.9

func (g Guid) Raw() [16]byte

type IdOption added in v0.0.6

type IdOption func(opts *idOptions) error

func WithMax added in v0.0.6

func WithMax(max int32) IdOption

func WithMin added in v0.0.6

func WithMin(min int32) IdOption

type RangeId added in v0.0.6

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

func NewRangeId added in v0.0.6

func NewRangeId(opts ...IdOption) *RangeId

func (*RangeId) Id added in v0.0.6

func (pmi *RangeId) Id() int32

Jump to

Keyboard shortcuts

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