idgen

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeBase58

func EncodeBase58(input string) string

EncodeBase58 encodes a unique ID using Base58 (shorter than Base64)

func EncodeBase64

func EncodeBase64(input string) string

EncodeBase64 encodes a unique ID using Base64 (for URL-safe versions)

Types

type ShortIDGenerator

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

ShortIDGenerator struct for configuration

func New

func New(length int, charset, timeFormat string) *ShortIDGenerator

New creates a new ShortIDGenerator with custom options

func (*ShortIDGenerator) Generate

func (g *ShortIDGenerator) Generate() string

Generate creates a unique, human-readable, timestamped ID

Jump to

Keyboard shortcuts

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