hxid

package
v0.2.59 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MPL-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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