bitmario/uuid0

Allow generating UUIDs with timsetamp=0

Opened this issue · 0 comments

pakal commented

I though about distinguishing "test uuids" in prod by setting their timestamp to 0, but the generator doesn't allow it:

def generate(ts: float=None) -> UUID:
    """Generate a new UUID. If the UNIX timestamp 'ts' is not given, the current time is used"""
    if not ts:
        ts = time.time()

How about putting "if ts is not None" here instead?