gen

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MachineBit = 53

MachineBit 机器码移位52

View Source
const TimestampBit = 12

TimestampBit 时间戳移位12

View Source
const WorkerBit = 10

WorkerBit 工作位数

Variables

This section is empty.

Functions

func Md5V

func Md5V(str string) string

func Md5V2

func Md5V2(str string) string

func Md5V3

func Md5V3(str string) string

func ToMd5Str

func ToMd5Str(name string) string

Types

type Snowflake added in v0.0.6

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

Snowflake 首位0,workid占有10位,时间戳41位,自增占用12位 Snowflake 改进简化版雪花算法

func NewSnowflake added in v0.0.6

func NewSnowflake(workerId int64) *Snowflake

NewSnowflake http://www.manongjc.com/detail/29-fixpagcswacgpvg.html NewSnowflake seata改进型雪花算法分布式ID-java实现

func (*Snowflake) Info added in v0.0.6

func (sf *Snowflake) Info() (int64, int64, int64)

func (*Snowflake) InfoString added in v0.0.6

func (sf *Snowflake) InfoString() (int64, string, int64)

func (*Snowflake) NextId added in v0.0.6

func (sf *Snowflake) NextId() int64

NextId 获取唯一id

Jump to

Keyboard shortcuts

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