# TSID

Key: `technology.identifier.tsid`

Time-Sorted ID, as defined by the tsid-creator reference implementation: a 64-bit value (42 bits of milliseconds since 2020-01-01T00:00:00Z, 10 node bits, 12 counter bits) written as 13 Crockford base32 characters. The first character is at most F because the value is 64 bits. Crockford decoding is case insensitive, so lower case is accepted. The published rule keeps to the canonical alphabet; decoders may also map I and L to 1 and O to 0, which is leniency in decoding, not part of the format.

Page: <https://meridian.online/docs/finetype/types/technology/identifier/tsid>

Samples: `0JMVQ049NFN6K`, `0SFTS78GP0CQ7`, `0T3WM4QFBK5NV`

## Use it

Shell

```shell
finetype infer -i '0JMVQ049NFN6K' --mode column
# → technology.identifier.tsid
```

DuckDB

```sql
SELECT ft_infer('0JMVQ049NFN6K');
-- → 'technology.identifier.tsid'
```

Cast template: {col} is your column

```sql
CAST({col} AS VARCHAR)
```

## How it's detected

The same 64-bit value can also be stored as an integer, which finetype types as an integer rather than as a tsid. Distinguishing a tsid from another 13-character alphanumeric ID needs a header or a timestamp check.
