-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathvalid.yml
More file actions
73 lines (64 loc) · 2.25 KB
/
valid.yml
File metadata and controls
73 lines (64 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This file contains test data that should parse as valid TypeIDs by conforming
# implementations.
#
# Each example contains:
# - The TypeID in its canonical string representation.
# - The prefix
# - The decoded UUID as a hex string
#
# Implementations should verify that they can encode/decode the data
# in both directions:
# 1. If the TypeID is decoded, it should result in the given prefix and UUID.
# 2. If the UUID is encoded as a TypeID with the given prefix, it should
# result in the given TypeID.
#
# In addition to using these examples, it's recommended that implementations
# generate a thousands of random ids during testing, and verify that after
# decoding and re-encoding the id, the result is the same as the original.
#
# In other words, the following property should always hold:
# random_typeid == encode(decode(random_typeid))
#
# Finally, while implementations should be able to decode the values below,
# note that not all of them are UUIDv7s. When *generating* new random typeids,
# implementations should always use UUIDv7s.
#
# Last updated: 2024-04-10 (for version 0.3.0 of the spec)
- name: nil
typeid: "00000000000000000000000000"
prefix: ""
uuid: "00000000-0000-0000-0000-000000000000"
- name: one
typeid: "00000000000000000000000001"
prefix: ""
uuid: "00000000-0000-0000-0000-000000000001"
- name: ten
typeid: "0000000000000000000000000a"
prefix: ""
uuid: "00000000-0000-0000-0000-00000000000a"
- name: sixteen
typeid: "0000000000000000000000000g"
prefix: ""
uuid: "00000000-0000-0000-0000-000000000010"
- name: thirty-two
typeid: "00000000000000000000000010"
prefix: ""
uuid: "00000000-0000-0000-0000-000000000020"
- name: max-valid
typeid: "7zzzzzzzzzzzzzzzzzzzzzzzzz"
prefix: ""
uuid: "ffffffff-ffff-ffff-ffff-ffffffffffff"
- name: valid-alphabet
typeid: "prefix_0123456789abcdefghjkmnpqrs"
prefix: "prefix"
uuid: "0110c853-1d09-52d8-d73e-1194e95b5f19"
- name: valid-uuidv7
typeid: "prefix_01h455vb4pex5vsknk084sn02q"
prefix: "prefix"
uuid: "01890a5d-ac96-774b-bcce-b302099a8057"
# Tests below were added in v0.3.0 when we started allowing '_' within the
# type prefix.
- name: prefix-underscore
typeid: "pre_fix_00000000000000000000000000"
prefix: "pre_fix"
uuid: "00000000-0000-0000-0000-000000000000"