![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /lib/python2.7/site-packages/josepy/ |
� �t0^c @ s4 d Z d d l Z d d l Z d � Z d � Z d S( s `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. i����Nc C sC t | t j � s- t d j t j � � � n t j | � j d � S( s� JOSE 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 s argument should be {0}t =( t isinstancet sixt binary_typet TypeErrort formatt base64t urlsafe_b64encodet rstrip( t data( ( s. /usr/lib/python2.7/site-packages/josepy/b64.pyt b64encode s c C s� t | t j � rH y | j d � } Wqi t k rD t d � � qi Xn! t | t j � si t d � � n t j | d d t | � d � S( s^ 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 t asciis5 unicode argument should contain only ASCII characterss# argument should be a str or unicodeR i ( R R t string_typest encodet UnicodeEncodeErrort ValueErrorR R R t urlsafe_b64decodet len( R ( ( s. /usr/lib/python2.7/site-packages/josepy/b64.pyt b64decode# s ( t __doc__R R R R ( ( ( s. /usr/lib/python2.7/site-packages/josepy/b64.pyt <module> s