xid

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package xid provides a unique identifier generator based on xid.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Setting added in v0.0.15

type Setting struct {
}

type XID

type XID struct{}

XID represents a unique identifier generator.

func New

func New(_ ...Setting) *XID

New creates a new instance of the XID identifier.

func (XID) Gen

func (x XID) Gen() string

Gen generates a new unique identifier.

func (XID) Name

func (x XID) Name() string

Name returns the name of the identifier.

func (XID) Size

func (x XID) Size() int

Size returns the size of the xid in bits.

func (XID) Validate

func (x XID) Validate(id string) bool

Validate checks if the provided id is a valid xid.

Jump to

Keyboard shortcuts

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