
    rf                     <    d dl Z d dlZd dlZd Zd Zd Zd Zd ZdS )    Nc                 *    t          | j                  S )zx
    Returns the given uuid.UUID object as a 22 character slug. This can be a
    regular v4 slug or a "nice" slug.
    )_convert_bytes_to_slugbytes)uuid_s    J/var/www/html/software/conda/lib/python3.11/site-packages/slugid/slugid.pyencoder   	   s    
 "%+...    c                     t          j        |           d d         }t          j        j        dk    r*t          |t                    r|                    d          }|S )N   zutf-8)base64urlsafe_b64encodesysversion_infomajor
isinstancer   decode)bytes_slugs     r   r   r      sQ    #F++CRC0D
""z$'>'>"{{7##Kr	   c                     t           j        j        dk    r*t          | t                    r|                     d          } | dz   } t          j        t          j	        |                     S )zQ
    Returns the uuid.UUID object represented by the given v4 or "nice" slug
    r   asciiz==)r   )
r   r   r   r   r   r   uuidUUIDr   urlsafe_b64decode)r   s    r   r   r      s\     ""z$'>'>"{{7##$;D963D99::::r	   c                  L    t          t          j                    j                  S )z=
    Returns a randomly generated uuid v4 compliant slug
    )r   r   uuid4r    r	   r   v4r   "   s     "$*,,"4555r	   c                      t          t          j                    j                  } | d         dz  | d<   t	          |           S )aZ  
    Returns a randomly generated uuid v4 compliant slug which conforms to a set
    of "nice" properties, at the cost of some entropy. Currently this means one
    extra fixed bit (the first bit of the uuid is set to 0) which guarantees the
    slug will begin with [A-Za-f]. For example such slugs don't require special
    handling when used as command line parameters (whereas non-nice slugs may
    start with `-` which can confuse command line tools).

    Potentially other "nice" properties may be added in future to further
    restrict the range of potential uuids that may be generated.
    r      )	bytearrayr   r   r   r   )rawBytess    r   nicer#   )   s:     +,,H1+$HQK!(+++r	   )r   r   r   r   r   r   r   r#   r   r	   r   <module>r$      sw    


  / / /  ; ; ;6 6 6, , , , ,r	   