eguid

package module
v0.0.0-...-56ba4a4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 5 Imported by: 0

README

guid

goproxy.cn Release Example

参数

Salt     string  #必须设置
Length   int     #如果在8位,加随机数到不了1亿,建议必须大于等于10
Alphabet string  #hashid默认的字母表

使用方法

g := guid.Load("guid").Build()
g.EncodeRandomInt64(45) // 使用这种比较安全,因为有随机数

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *config

DefaultConfig ...

Types

type Component

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

func (*Component) DecodeInt64WithError

func (c *Component) DecodeInt64WithError(hash string) (int64, error)

func (*Component) EncodeInt64

func (c *Component) EncodeInt64(id int64) (string, error)

func (*Component) EncodeRandomInt64

func (c *Component) EncodeRandomInt64(id int64) (string, error)

type Container

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

Container 容器

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer 默认容器

func Load

func Load(key string) *Container

Load 加载配置key

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

Build 构建组件

type Option

type Option struct{}

Jump to

Keyboard shortcuts

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