|
7 | 7 | Example ZUID:
|
8 | 8 |
|
9 | 9 | ```
|
10 |
| -1-1b123a2f0-qw2n4 |
| 10 | +structure: component1-component2-component3 |
| 11 | +lengths: maxlen5-maxlen10-maxlen35 |
| 12 | +
|
| 13 | +e.g. 1-1b123a2f0-qw2n4 |
11 | 14 | ```
|
12 | 15 |
|
13 | 16 | ## Component 1: Entity Prefix
|
14 | 17 |
|
15 |
| -* Component 1 is an integer (ultimately stored as part of a string) |
16 |
| -* There is no direct limit on length of this component other than the total ZUID length of 50 characters. However, it is pretty unlikely it will exceed 5 characters. |
| 18 | +* Is an integer (ultimately stored as part of a string) |
| 19 | +* Limited to 5 characters. |
17 | 20 |
|
18 |
| -These string integers are static representations of specific entity types and are provided in each library as some form of constant. |
| 21 | +*These string integers are static representations of specific entity types and are provided in each library as some form of constant.* |
19 | 22 |
|
20 | 23 | ## Component 2: Time Encoded as a String
|
21 | 24 |
|
22 |
| -* This is encoded as hexidecimal like `a3f13d` |
23 |
| -* We substract `1420070400` to shorten the hash slightly |
24 |
| - * `1420070400` is January 1st, 2015 (in seconds), before the first zuid was generated |
25 |
| -* There is also no direct limit on the length of this component (other than the total ZUID length). |
26 |
| - |
| 25 | +* __Can NOT be seconds based measurement.__ This is not precise enough for unique hashes. |
| 26 | +* Must be 10 characters |
| 27 | +* Encoded as hexidecimal string like `d0f1b38ad3` |
27 | 28 |
|
28 | 29 | Example:
|
29 | 30 |
|
30 | 31 | ```
|
31 | 32 | Date (and time):
|
32 |
| -Wed Apr 12 2017 14:53:06 GMT-0700 (PDT) |
| 33 | +2018-03-23 14:36:18.643025 -0700 PDT m=+0.000811554 |
33 | 34 |
|
34 |
| -In seconds: |
35 |
| -1492033987 |
| 35 | +In nano seconds: |
| 36 | +1521840978643025000 |
36 | 37 |
|
37 | 38 | As hex:
|
38 |
| -"58eea1c3" |
| 39 | +"d0f1b38ad3" |
39 | 40 | ```
|
40 | 41 |
|
41 | 42 | ## Component 3: A Random Alphanumeric String
|
42 | 43 |
|
43 | 44 | * This is a random alphanumeric string.
|
44 |
| -* It is by default generated as 5 characters long. |
45 |
| -* It can be generated as up to 15 characters if more possibilities as desired |
46 |
| -* It randomly selects from the characters `bcdfghjklmnpqrstvwxz0123456789` |
| 45 | +* Minimum of 6 character length. |
| 46 | +* Maximum of 35 characters length. |
| 47 | +* It randomly selects from the character set `bcdfghjklmnpqrstvwxz0123456789` |
47 | 48 | * It does not use vowels to avoid forming words in IDs
|
48 | 49 |
|
49 | 50 |
|
50 | 51 | # Libraries
|
51 | 52 |
|
52 |
| -* [zuid-js](https://github.com/zesty-io/zuid-specification) |
| 53 | +* [zuid-js](https://github.com/zesty-io/zuid-js) |
53 | 54 | * [zuid-php](https://github.com/zesty-io/zuid-php)
|
54 | 55 | * [zuid-mysql](https://github.com/zesty-io/zuid-mysql)
|
55 | 56 |
|
|
0 commit comments