oittaa/uuid6-python

Max UUID

0xflotus opened this issue · 2 comments

The draft specifies a max UUID of FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF. Do you think you need this special UUID as a feature in this library?

Bildschirmfoto 2022-11-15 um 23 36 30

If you ever need the max UUID you can always use this:

from uuid import UUID
>>> UUID(int=2**128 - 1)
UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')

There's no difference with doing it from uuid6 as the lib generates UUID objects.

oittaa commented

There's also the "Nil UUID" in the spec. I just don't know if there's much value to define "Nil UUID" and "Max UUID" in this library. You can do it like @jleclanche showed above or like they do in the official library.

from uuid import UUID
UUID_NIL = UUID('00000000-0000-0000-0000-000000000000')
UUID_MAX = UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')