randomkey

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package randomkey 随机生成一个key 使用sony实现的snowflake算法 默认的设置为 StartTime: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC),MachineID则会默认尝试使用本机的第一张网卡的mac地址最后1位,如果获取不到则会使用默认值0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMachineID

func GetMachineID() uint16

GetMachineID 获取生成器的MachineID

func InitGenerator

func InitGenerator(opt sonyflake.Settings) *sonyflake.Sonyflake

InitGenerator 初始化默认生成器

func Next

func Next() (string, error)

Next 随机生成key

Types

This section is empty.

Jump to

Keyboard shortcuts

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