UUID

15 projects

Go's standard library has no UUID package, so nearly every project picks one from this category. Beyond classic UUIDs, it includes other ID schemes: ULID and xid are sortable by creation time, NanoID produces short URL-safe strings, and some generators embed metadata or favor speed. The main choices are format, sort order, length and whether IDs must be unguessable.

google/uuid is the most used package for creating and parsing RFC 4122 UUIDs and includes version 7, though it has been quiet since late 2024. gofrs/uuid is an actively maintained alternative that implements the newer RFC 9562 versions, including time-ordered v6 and v7. oklog/ulid generates ULIDs, which are 128-bit, lexicographically sortable and encoded in Crockford base32. rs/xid produces compact 12-byte IDs similar to MongoDB ObjectIDs. Smaller packages such as nanoid, sno and wuid cover short, metadata-carrying or high-throughput IDs.

For database primary keys, time-ordered IDs such as UUIDv7 or ULID keep B-tree indexes compact because new rows land at the end of the index, unlike random v4 UUIDs. Use v4 when IDs must reveal nothing about creation time. Avoid exposing sequential or time-based IDs where guessability matters, such as password reset links.

uuidby google

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.

github.com/google/uuidNo dependencies v1.6.0updated 1y ago

6.2k

ulidby oklog

Go implementation of ULID (Universally Unique Lexicographically Sortable Identifier).

github.com/oklog/ulid/v2Go 1.15+ 1 dependencyv2.1.2updated 4d ago

5.1k

xidby rs

Xid is a globally unique id generator library, ready to be safely used directly in your server code.

github.com/rs/xidGo 1.16+ No dependencies v1.2.1updated 1mo ago

4.3k

uuidby gofrs

Implementation of Universally Unique Identifier (UUID). Supports both creation and parsing of UUIDs. Actively maintained fork of satori uuid.

github.com/gofrs/uuid/v5Go 1.25+ No dependencies v5.5.1updated today

1.8k

wuidby edwingeng

An extremely fast globally unique number generator.

github.com/edwingeng/wuidGo 1.18+ 5 dependenciesupdated 2y ago

541

snoby muyo

Compact, sortable and fast unique IDs with embedded metadata.

github.com/muyo/snoGo 1.14+ No dependencies v1.2.1updated 4y ago

93

guidby sdrapkin

Fast cryptographically safe Guid generator for Go (~10x faster than uuid).

github.com/sdrapkin/guidGo 1.27+ No dependencies updated 1mo ago

75

nanoidby aidarkhanov

A tiny and efficient Go unique string ID generator.

github.com/aidarkhanov/nanoid/v2Go 1.14+ No dependencies updated 4y ago

62

goidby jakehl

Generate and Parse RFC4122 compliant V4 UUIDs.

github.com/jakehl/goidNo dependencies updated 7y ago

41

nanoidby sixafter

Efficient, cryptographically secure generator for fast, concurrent NanoID and UUID creation.

github.com/sixafter/nanoidGo 1.27+ 4 dependenciesv1.66.0updated 4d ago

36

gouidby twharmon

Generate cryptographically secure random string IDs with just one allocation.

github.com/twharmon/gouidGo 1.25+ No dependencies v0.6.0updated 8mo ago

25

uuidby agext

Generate, encode, and decode UUIDs v1 with fast or cryptographic-quality random node identifier.

github.com/agext/uuidNo dependencies v1.1.0updated 6y ago

18

uuidcheckby ashwingopalsamy

A tiny, dependency-free Go library that validates UUIDs against standard RFC 4122 formatting, converts UUIDv7() into UTC timestamps.

github.com/ashwingopalsamy/uuidcheckGo 1.23+ No dependencies v1.0.1updated 1y ago

6

fastuuidby rekby

Fast generate UUIDv4 as string or bytes.

github.com/rekby/fastuuidGo 1.20+ 2 dependenciesv0.9.0updated 3y ago

1
u

uniq

No hassle safe, fast unique identifiers with commands.

gitlab.com

Esc

Type to search every entry. ↑↓ to move, Enter to open.