shortid

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KSUID

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

func New

func New(_ ...Setting) *KSUID

New creates a new KSUID generator with a unique node.

func (KSUID) Gen

func (s KSUID) Gen() string

Gen generates a new KSUID ID as a string.

func (KSUID) Name

func (s KSUID) Name() string

Name returns the name of the generator.

func (KSUID) Size

func (s KSUID) Size() int

Size returns the bit size of the generated KSUID ID.

func (KSUID) Validate

func (s KSUID) Validate(id string) bool

Validate checks if the provided ID is a valid KSUID ID.

type Setting added in v0.0.15

type Setting struct {
}

Jump to

Keyboard shortcuts

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