idgen

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeToUint64

func DecodeToUint64(s string) uint64

Decodes the given base58 encoded data to Uint64

func DecodeToUuid

func DecodeToUuid(s string) (uuid.UUID, error)

Decodes the given base58 encoded string to UUID

func Encode

func Encode(u uuid.UUID) string

Encodes the given UUID to base58

func EncodeUint64

func EncodeUint64(v uint64) string

Encodes the given uint64 using base58

func GenerateId

func GenerateId(ctx context.Context) uint64

func NewId

func NewId() string

Generates a new ID, based on short UUID.

func NewSnowflakeId

func NewSnowflakeId() uint64

Generates a new ID, based on snowflake implementation.

func NewSnowflakeIdEnc

func NewSnowflakeIdEnc() string

Generates a base58 encoded new ID, based on snowflake implementation

Types

This section is empty.

Jump to

Keyboard shortcuts

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