ulid

package
v1.34.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const EncodedSize = 26

EncodedSize is the encoded length of a ulid.

Variables

View Source
var ErrInvalidULID = errors.New("invalid ulid")

ErrInvalidULID is returned if the ULID is in an invalid format.

Functions

func NewULID

func NewULID() string

NewULID constructs a new randomized ulid in lowercase.

Types

type ULID

type ULID [16]byte

ULID is the parsed binary ULID value.

func ParseULID

func ParseULID(id string) (ULID, error)

ParseULID parses and validates the lowercase ulid is the correct format.

func (ULID) String added in v1.34.4

func (u ULID) String() string

String returns the lowercase string encoding.

func (ULID) Time added in v1.34.4

func (u ULID) Time() uint64

Time returns the Unix millisecond timestamp component.

Jump to

Keyboard shortcuts

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