2
0
Fork 0

feat: make v7 UUID values instead of v1

this is thanks to the presentation at
https://www.youtube.com/watch?v=n9Cxs0sTqEY

the basic rationale is that:

- v1 UUID is "less private" in that MAC address can be deduced
- v7 UUID has "better index performance" per sortable prefix

we also need to store these as true UUID data type in postgres, but
that will be a separate effort..
This commit is contained in:
Lance Edgar 2024-11-30 12:26:56 -06:00
parent ecdfb2f6e0
commit cd90626f1d
2 changed files with 4 additions and 2 deletions

View file

@ -32,6 +32,7 @@ dependencies = [
"progress", "progress",
"python-configuration", "python-configuration",
"typer", "typer",
"uuid7",
] ]

View file

@ -28,7 +28,8 @@ import importlib
import logging import logging
import os import os
import shlex import shlex
from uuid import uuid1
from uuid_extensions import uuid7
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -176,7 +177,7 @@ def make_uuid():
:returns: A 32-character hex string. :returns: A 32-character hex string.
""" """
return uuid1().hex return uuid7().hex
def parse_bool(value): def parse_bool(value):