https://github.com/attitude/universal-time-identificator
Time÷based ID in nanoseconds
https://github.com/attitude/universal-time-identificator
Last synced: 3 months ago
JSON representation
Time÷based ID in nanoseconds
- Host: GitHub
- URL: https://github.com/attitude/universal-time-identificator
- Owner: attitude
- License: mit
- Created: 2021-03-19T14:54:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-19T16:13:17.000Z (about 4 years ago)
- Last Synced: 2025-01-18T02:14:46.581Z (5 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Universal Time Identificator
- Time÷based sortable ID
- URL friendly, uses just 9 characters/bytes
- SHould work for more than next 500 yearsAttribute | Value | Note
-------------------|------------------------|-----
Alphabet base | 6 bits | 2 ^ 6 = 64
Alphabet count | 64 letters | `-`, `0-9`, `A-Z`, `_`, `a-z`
Nanoseconds base | 54 bits | 6 bits per letter * 9 letters
Time sortable | YES | Alphabet is in ASCII order**Examples:**
ID | Nanoseconds | Date and time
-------------------|------------------------|--------------
`4jT09VzfN` | 01 616 145 904 040 664 | Fri Mar 19 2021 09:25:04.040664 GMT+0000
`4p6ZWOQk-` | 01 640 995 200 000 000 | Sat Jan 01 2022 00:00:00.000000 GMT+0000
`V---------` (max) | 18 014 398 509 481 984 | Mon Nov 07 2540 23:35:09.481984 GMT+0000---
## Instal with Composer
Edit `composer.json`:
```json
{
...,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/attitude/universal-time-identificator"
}
],
"require": {
"attitude/universal-time-identificator": "dev-main"
}
}
```## Usage
```php