-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
Description
According to the spec, the typeid 00000000000000000000000000 should become an all-zero uuid:
Implementations SHOULD allow encoding/decoding of other UUID variants when the bits are provided by end users. This makes it possible for applications to encode other UUID variants like UUIDv1 or UUIDv4 at their discretion.
- name: nil
typeid: "00000000000000000000000000"
prefix: ""
uuid: "00000000-0000-0000-0000-000000000000"
However, this implementation seems to be converting it to a uuid7 00000000-0000-7000-8000-000000000000
In [1]: from typeid import TypeID
In [2]: TypeID(suffix="00000000000000000000000000")
Out[2]: TypeID('00000000000000000000000000')
In [3]: TypeID(suffix="00000000000000000000000000").uuid
Out[3]: UUID('00000000-0000-7000-8000-000000000000')
Which means it is not roundtrip-safe when converting back to a typeid:
In [4]: TypeID.from_uuid(TypeID(suffix="00000000000000000000000000").uuid)
Out[4]: TypeID('0000000000e008000000000000')