gen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptCheck added in v0.0.2

func BcryptCheck(password, hash string) bool

BcryptCheck 对比明文密码和数据库的哈希值

func BcryptHash added in v0.0.2

func BcryptHash(password string) string

BcryptHash 使用 bcrypt 对密码进行加密

func Random

func Random(n int, src string) string

func RandomLower

func RandomLower(n int) string

func RandomNumber

func RandomNumber(n int) string

func RandomString

func RandomString(n int) string

生成 n 个随机数,包含数字、大小写字母,不含其它特殊符号

func SnowflakeId

func SnowflakeId() int64

Types

type SnowflakeWorker

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

func NewSnowflakeWorker

func NewSnowflakeWorker(workerId int64) (*SnowflakeWorker, error)

func (*SnowflakeWorker) GetId

func (w *SnowflakeWorker) GetId() int64

Jump to

Keyboard shortcuts

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