hxid

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

README

Globally Unique ID Generator

Thin wrapper around github.com/oklog/ulid/v2 that renders the 16-byte ULID as base58 instead of the native Crockford base32. ULIDs are lexicographically time-sortable, so New() and NewTimeSort() are aliases retained for call-site compatibility.

Documentation

Overview

Package hxid produces sortable, base58-encoded unique IDs backed by ULIDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

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

ID is a 16-byte ULID rendered as base58 via String().

func New

func New() ID

New returns a freshly generated, time-sortable ID.

func NewTimeSort

func NewTimeSort() ID

NewTimeSort is retained for call-site compatibility with the previous hxid API. Every ULID is already lexicographically time-sortable, so it is an alias for New.

func (ID) String

func (id ID) String() string

String returns the base58 encoding of the underlying 16-byte ULID.

Jump to

Keyboard shortcuts

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