# rs/xid

xid is a globally unique id generator thought for the web

Repository: https://github.com/rs/xid
Canonical: https://ross.abutalabs.com/products/xid
Language: Go
License: MIT
License Family: permissive
Last push: 2026-08-26T02:22:27+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 8, longevity 100
- inputs: {"age_days": 3949, "days_push": 8, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4282, forks 214 (observed 2026-08-28T04:08:41.223820+00:00)

## What it is
xid is a Go library for generating globally unique, sortable 12-byte identifiers using the Mongo Object ID algorithm with a compact base32hex string encoding. It requires no configuration or central generator server, making it safe to use directly in server code.

## Use cases
- generate unique ids for database records without a central coordinator
- create shorter URL-safe ids than UUIDs for web APIs
- generate sortable ids that sort by creation time
- replace UUIDs with more compact identifiers in Go services
- generate Mongo-compatible object IDs outside MongoDB

## When to choose
- you need configuration-free globally unique ids in Go
- you want sortable, time-ordered identifiers
- you need compact URL-safe string ids (20 chars)
- you want Mongo Object ID binary compatibility

## When to avoid
- you need cryptographically random, unguessable ids
- you require 128-bit uniqueness guarantees like UUIDv4
- your project is not in Go
- you need decentralized ids without machine-identifier assumptions

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, databases, web-development
- platform: go, cross-platform
- tags: unique-id-generator, sortable-ids, mongodb-objectid, base32hex, uuid-alternative

## Member repositories
- rs/xid (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:41.223820+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:58.129772+00:00, confidence not recorded.
  - readme: https://github.com/rs/xid (fetched 2026-08-28T04:08:41.223820+00:00, sha 788296f7d94c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
