a
    “˜ëj§  ã                   @   s’   d dl mZmZmZmZmZmZmZmZm	Z	m
Z
 d dlZe	dƒZe	dƒZddd„Zdd„ Zd	d
„ Zdd„ Zddd„Zddd„Zdd„ Zg d¢ZdS )é    )
ÚNAMESPACE_DNSÚNAMESPACE_OIDÚNAMESPACE_URLÚNAMESPACE_X500ÚRESERVED_FUTUREÚRESERVED_MICROSOFTÚRESERVED_NCSÚRFC_4122ÚUUIDÚgetnodeNz$00000000-0000-0000-0000-000000000000z$ffffffff-ffff-ffff-ffff-ffffffffffffc                 C   s   t t | |¡jd�S )a  Generate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen.©Úint)r
   Ú
uuid_utilsÚuuid1r   )ÚnodeÚ	clock_seq© r   úY/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/uuid_utils/compat/__init__.pyr      s    r   c                 C   s(   | rt  | j¡n| } tt  | |¡jd�S )zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.r   )r   r
   ÚhexÚuuid3r   ©Ú	namespaceÚnamer   r   r   r      s    r   c                   C   s   t t ¡ jd�S )zGenerate a random UUID.r   )r
   r   Úuuid4r   r   r   r   r   r   "   s    r   c                 C   s(   | rt  | j¡n| } tt  | |¡jd�S )zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.r   )r   r
   r   Úuuid5r   r   r   r   r   r   '   s    r   c                 C   s   t t | |¡jd�S )z®Generate a version 6 UUID using the given timestamp and a host ID.
    This is similar to version 1 UUIDs,
    except that it is lexicographically sortable by timestamp.
    r   )r
   r   Úuuid6r   )r   Ú	timestampr   r   r   r   -   s    r   c                 C   s   t t | |¡jd�S )z>Generate a version 7 UUID using a time value and random bytes.r   )r
   r   Úuuid7r   )r   Znanosr   r   r   r   5   s    r   c                 C   s   t t | ¡jd�S )zHGenerate a custom UUID comprised almost entirely of user-supplied bytes.©Úbytes)r
   r   Úuuid8r   r   r   r   r   r    :   s    r    )ÚMAXr   r   r   r   ÚNILr   r   r   r	   r
   r   r   r   r   r   r   r   r    )NN)NN)NN)Úuuidr   r   r   r   r   r   r   r	   r
   r   r   r"   r!   r   r   r   r   r   r   r    Ú__all__r   r   r   r   Ú<module>   s   0


