
    	D,j'                         U d dl Z d dlZd dlmZ dZddddZeeef         ed<   ded	ed
efdZ	de
d
efdZdeded
eeef         fdZd
efdZdS )    N)Dictz$experiment_startedhttpszapplication/json)zX-SchemezX-Forwarded-ProtozContent-TypeREQUEST_HEADERSkeysaltreturnc                     t          |                     d          |                    d          z             }|dz  dz  S )zCompute a normalized hash using FNV-1a algorithm.

    :param key: The key to hash
    :param salt: Salt to add to the hash
    :return: Normalized hash value between 0.0 and 1.0
    zutf-8d   g      Y@)_fnv1a64encode)r   r   
hash_values      c/home/rurouni/.local/share/uv/tools/aider-chat/lib/python3.11/site-packages/mixpanel/flags/utils.pynormalized_hashr      s>     #**W--G0D0DDEEJ%%    datac                 6    d}d}| D ]}||z  }||z  }|dz  }|S )z`FNV-1a 64-bit hash function.

    :param data: Bytes to hash
    :return: 64-bit hash value
    l      l   %#Ds_ l     )r   	FNV_primer   bytes       r   r   r      sD     I#J ) )d
i
((

r   tokensdk_versionc                     d|| d}|S )zPrepare common query string parameters for feature flag evaluation.

    :param token: The project token
    :param sdk_version: The SDK version
    :return: Dictionary of common query parameters
    python)mp_liblib_versionr   r   )r   r   paramss      r   prepare_common_query_paramsr   '   s      " F Mr   c                      t          j                    j        } t          j                    j        dd         }d}d|  d| d| }|S )zGenerates a W3C traceparent header for easy interop with distributed tracing systems i.e Open Telemetry
    https://www.w3.org/TR/trace-context/#traceparent-header
    :return: A traceparent string
    N   01z00--)uuiduuid4hex)trace_idspan_idtrace_flagstraceparents       r   generate_traceparentr)   6   sS    
 z||Hjllss#G K:::7::[::Kr   )r"   httpxtypingr   EXPOSURE_EVENTr   str__annotations__floatr   bytesintr   r   r)   r   r   r   <module>r2      s          &  &# #c3h   & &C &E & & & &5 S     s  c3h    c      r   