---
id: "ksuid"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["identifiers"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/ksuid"
---

# KSUID (K-Sortable Unique Identifier) (`ksuid`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

160-bit identifier from Segment's ksuid library. It is a 32-bit timestamp in seconds since 13 May 2014 (Unix time 1400000000) followed by 128 random bits, so values sort by creation time. The text form is always 27 base62 characters (digits, uppercase and lowercase letters) without separators. The largest KSUID is aWgEPTl1tmebfsQzFP4bxwgy80V, so the first character is a digit, an uppercase letter or a.

- Personal data (PII): no
- Categories: Universal unique identifiers (identifiers)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[0-9A-Za][0-9A-Za-z]{26}$
```

## Examples

- `0ujtsYcgvSTl8PAuAdqWYSMnLOv` — KSUID inspected in the ksuid README, created 2017-10-10 04:00:47 UTC
- `0ujsswThIGTUYm2K8FjOOfXtY1K` — KSUID generated in the ksuid README
- `aWgEPTl1tmebfsQzFP4bxwgy80V` — Largest KSUID
- `0ujtsYcgvSTl8PAuAdqWYSMnLO` (invalid example) — 26 characters
- `0ujtsYcgvSTl8PAuAdqWYSM-LOv` (invalid example) — The hyphen is not a base62 character

## Translations

- ru: KSUID (K-сортируемый уникальный идентификатор)

## Sources

- doc: <https://github.com/segmentio/ksuid>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/ksuid.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/identifiers/ksuid.yaml>
