gen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(b []byte) string

ByteToString String and []byte buffers may converted without memory allocations This is an unsafe way, the result string and []byte buffer share the same bytes. Please make sure not to modify the bytes in the []byte buffer if the string still survives!

func Init added in v0.0.2

func Init(serviceName string, serviceId uint64)

func Int64 added in v0.0.2

func Int64() int64

func SnowflakeID

func SnowflakeID() (uint64, error)

SnowflakeID 生成雪花ID

func StringToByte

func StringToByte(s string) (b []byte)

StringToByte String and []byte buffers may converted without memory allocations This is an unsafe way, the result string and []byte buffer share the same bytes. Please make sure not to modify the bytes in the []byte buffer if the string still survives!

func UUID

func UUID() string

UUID 生成UUID

func Uint64 added in v0.0.2

func Uint64() uint64

func ValidPhoneNumber

func ValidPhoneNumber(phone string) bool

ValidPhoneNumber 正则验证手机号

Types

This section is empty.

Jump to

Keyboard shortcuts

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