eFdZddlZddlmZdedefdZdeeefdefdZy)a`JOSE Base64`_ is defined as: - URL-safe Base64 - padding stripped .. _`JOSE Base64`: https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-37#appendix-C .. Do NOT try to call this module "base64", as it will "shadow" the standard library. N)Uniondatareturnct|ts tdtj|j dS)zJOSE Base64 encode. :param data: Data to be encoded. :type data: bytes :returns: JOSE Base64 string. :rtype: bytes :raises TypeError: if ``data`` is of incorrect type zargument should be bytes=) isinstancebytes TypeErrorbase64urlsafe_b64encoderstriprs ,/usr/lib/python3/dist-packages/josepy/b64.py b64encoders6 dE "233  # #D ) 0 0 66ct|tr |jd}nt|t s t dtj|ddt|dzz zzS#t$r t dwxYw)a^JOSE Base64 decode. :param data: Base64 string to be decoded. If it's unicode, then only ASCII characters are allowed. :type data: bytes or unicode :returns: Decoded data. :rtype: bytes :raises TypeError: if input is of incorrect type :raises ValueError: if input is unicode with non-ASCII characters asciiz5unicode argument should contain only ASCII charactersz#argument should be a str or unicoder) rstrencodeUnicodeEncodeError ValueErrorr r r urlsafe_b64decodelenrs r b64decoder"s$ V;;w'De $=>>  # #D41D A 3F+G$G HH " VTU U Vs A))A>)__doc__r typingrr rrrrrrsD 7E7e7"IE%*%I%Ir