summaryrefslogtreecommitdiff
path: root/server/lib/uuid.py
blob: e77e3a88349b957774c2c7d46cdcb024bab6532b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from uuid import UUID, uuid4

def validate(uuid_to_test, version=4):
    try:
        uuid_obj = UUID(uuid_to_test, version=version)
    except:
        return False

    return str(uuid_obj) == uuid_to_test

def gen():
    return str(uuid4())