grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ±f‡j_Vã@sÞ ddlZddlZddlZgd¢ZeefZdd„ZdPdd„ZdQdd „Z d d „Z d d „Z e  dd¡Z e  dd¡Zdd„Zdd„ZdZdZdZdZdZiaiadd„ZdRdd„Zdd„Zejdd �e_dRd!d"„Zejded#�e_d$d%„Zejd&d �e_dSd'd(„Zejd&d)d#�e_d*d+„Z dSd,d-„Z!da"da#d.Z$d/Z%dTd0d1„Z&ddddd2œd3d4„Z'ddd5d6œd7d8„Z(d9Z)da*da+da,dSd:d;„Z-dZ/e/d?d@Z0dAdB„Z1dCdD„Z2dEdF„Z3dGdH„Z4dIdJ„Z5dKdL„Z6dMdN„Z7e8dOkríe6ƒdSdS)UéN)ÚencodeÚdecodeÚ encodebytesÚ decodebytesÚ b64encodeÚ b64decodeÚ b32encodeÚ b32decodeÚ b32hexencodeÚ b32hexdecodeÚ b16encodeÚ b16decodeÚ b85encodeÚ b85decodeÚ a85encodeÚ a85decodeÚstandard_b64encodeÚstandard_b64decodeÚurlsafe_b64encodeÚurlsafe_b64decodecCslt|tƒrz| d¡WStytdƒ‚wt|tƒr|Szt|ƒ ¡WSty5td|j j ƒd‚w)NÚasciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r) Ú isinstanceÚstrrÚUnicodeEncodeErrorÚ ValueErrorÚ bytes_typesÚ memoryviewÚtobytesÚ TypeErrorÚ __class__Ú__name__©Ús©r#ú-/opt/alt/python310/lib64/python3.10/base64.pyÚ_bytes_from_decode_data"s"   ÿ  ÿÿÿr%cCs. tj|dd�}|dur| t d|¡¡S|S)NF)Únewlineó+/)ÚbinasciiÚ b2a_base64Ú translateÚbytesÚ maketrans)r"ÚaltcharsÚencodedr#r#r$r3s rFcCsð t|ƒ}d}|dur6t|ƒ}t|ƒdkrtd|›�ƒ‚dD]}||vr,||vr,|}nq| t |d¡¡}|rCt d|¡sCt  d¡‚t  |¡}|durvddl }|re|j dt |ƒ›d|›d �tdd �|S|j dt |ƒ›d|›d �tdd �|S) Nézinvalid altchars: r's[A-Za-z0-9+/]*={0,2}zNon-base64 digit foundrúinvalid character z in Base64 data with altchars=z= and validate=True will be an error in future Python versions©Ú stacklevelz? and validate=False will be discarded in future Python versions)r%Úlenrr*r+r,ÚreÚ fullmatchr(ÚErrorÚ a2b_base64ÚwarningsÚwarnÚchrÚDeprecationWarningÚ FutureWarning)r"r-ZvalidateÚbadcharÚbÚresultr8r#r#r$rAs> €  ÿý üÿýrcCó t|ƒS©N)rr!r#r#r$rmsrcCr@rA)rr!r#r#r$rtsrr's-_cCs t|ƒ t¡SrA)rr*Ú_urlsafe_encode_translationr!r#r#r$r‚srcCsl t|ƒ}d}dD] }||vr|}nq | t¡}t |¡}|dur4ddl}|jdt|ƒ›d�tdd�|S)Nr'rr0zD in URL-safe Base64 data will be discarded in future Python versionsr/r1) r%r*Ú_urlsafe_decode_translationr(r7r8r9r:r<)r"r=r>r?r8r#r#r$r‹s  þ  þrzK Encode the bytes-like objects using {encoding} and return a bytes object. aƒ Decode the {encoding} encoded bytes-like object or ASCII string s. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. {extra_args} The result is returned as a bytes object. A binascii.Error is raised if the input is incorrectly padded or if there are non-alphabet characters present in the input. a´ RFC 3548 allows for optional mapping of the digit 0 (zero) to the letter O (oh), and for optional mapping of the digit 1 (one) to either the letter I (eye) or letter L (el). The optional argument map01 when not None, specifies which letter the digit 1 should be mapped to (when map01 is not None, the digit 0 is always mapped to the letter O). For security purposes the default is None, so that 0 and 1 are not allowed in the input. s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567s 0123456789ABCDEFGHIJKLMNOPQRSTUVcsR|tvrdd„|Dƒ‰‡fdd„ˆDƒt|<d‰t|tƒs#t|ƒ ¡}t|ƒd}|r3|dd|}tƒ}tj}t|}t dt|ƒdƒD]+}||||d…dƒ}|||d?||d ?d @||d ?d @||d @7}qE|d krd |dd…<t |ƒS|dkr�d|dd…<t |ƒS|dkr›d|dd…<t |ƒS|dkr¥d|dd…<t |ƒS)NcSóg|]}t|fƒ‘qSr#©r+©Ú.0Úir#r#r$Ú Èóz_b32encode..csg|] }ˆD]}||‘qqSr#r#©rGÚar>©Zb32tabr#r$rIÉóéórÚbigééiÿé és======iúÿÿÿr/s====éüÿÿÿés===éýÿÿÿéó=éÿÿÿÿ) Ú_b32tab2rrrrr3Ú bytearrayÚintÚ from_bytesÚranger+)Úalphabetr"Úleftoverr.r_Zb32tab2rHÚcr#rMr$Ú _b32encodeÃsB    ÿþ ý ú ü þ rdc Cst|tvrdd„t|ƒDƒt|<t|ƒ}t|ƒdrt d¡‚|dur1t|ƒ}| t dd|¡¡}|r7|  ¡}t|ƒ}|  d¡}|t|ƒ}t ƒ}t|}t dt|ƒdƒD]1}|||d…} d} z| D] } | d >|| } qdWn t y}t d ¡d‚w||  d d ¡7}qU|ds�|d vr”t d¡‚|r¶|r¶| d |K} |  d d ¡} d d |d} | d| …|dd…<t|ƒS)NcSsi|]\}}||“qSr#r#)rGÚkÚvr#r#r$Ú ìrJz_b32decode..ézIncorrect paddings01óOrZrrOzNon-base32 digit foundrQ>rrUrWrYéé+éûÿÿÿ)Ú_b32revÚ enumerater%r3r(r6r*r+r,ÚupperÚrstripr]r`ÚKeyErrorÚto_bytes)rar"ÚcasefoldÚmap01ÚlZpadcharsÚdecodedZb32revrHZquantaÚaccrcZlastrbr#r#r$Ú _b32decodeçsD    ÿ  ÿ   rxcCó tt|ƒSrA)rdÚ _b32alphabetr!r#r#r$ró rZbase32)ÚencodingcCstt|||ƒSrA)rxrz)r"rsrtr#r#r$r sr )r|Z extra_argscCryrA)rdÚ_b32hexalphabetr!r#r#r$r r{r Z base32hexcCs tt||ƒSrA)rxr}©r"rsr#r#r$r #s r ÚcCs t |¡ ¡SrA)r(Zhexlifyror!r#r#r$r -sr cCs6 t|ƒ}|r | ¡}t d|¡rt d¡‚t |¡S)Ns [^0-9A-F]zNon-base16 digit found)r%ror4Úsearchr(r6Z unhexlifyr~r#r#r$r 3s    r s<~s~>c s¬t|tƒs t|ƒ ¡}t|ƒ d}|r|d|}t dt|ƒd¡ |¡}‡‡‡‡fdd„|Dƒ}|rQ|sQ|ddkrFˆdd |d<|dd| …|d<d  |¡S) NrYrPz!%dIcsPg|]$}ˆr |s dnˆr|dkrdnˆ|dˆ|ddˆ|d‘qS)ózi óyií^ éUi9r#)rGZword©ÚcharsÚchars2ÚfoldnulsÚ foldspacesr#r$rIWs û ÿ þþz_85encode..r[r�rrOó) rrrrr3ÚstructÚStructZunpackÚjoin) r>r…r†Úpadr‡rˆÚpaddingZwordsÚchunksr#r„r$Ú _85encodeMs   û  r�)rˆÚwrapcolr�Úadobecs¼ tdurdd„tddƒDƒadd„tDƒat|tt|d|ƒ‰|r%tˆ‰ˆrVt|r,dndˆƒ‰‡‡fd d„td tˆƒˆƒDƒ}|rQt|d ƒdˆkrQ| d ¡d  |¡‰|r\ˆt 7‰ˆS)NcSrDr#rErFr#r#r$rIzrJza85encode..é!évcSóg|] }tD]}||‘qqSr#)Ú _a85charsrKr#r#r$rI{rNTr/rUcsg|] }ˆ||ˆ…‘qSr#r#rF©r?r‘r#r$rIƒsÿrr[r‰ó ) Ú _a85chars2r`r–r�Ú _A85STARTÚmaxr3ÚappendrŒÚ_A85END)r>rˆr‘r�r’r�r#r—r$res& ÿ  rs )rˆr’Ú ignorecharsc Cs| t|ƒ}|r%| t¡std t¡ƒ‚| t¡r|dd…}n|dd…}t d¡j }g}|j }g}|j }|j } |dD]k} d| krHdkr}nn3|| ƒt |ƒdkr|d } |D] } d | | d} qXz||| ƒƒWn tj yxtd ƒd‚w| ƒq<| d krŒ|r‡td ƒ‚|dƒq<|r�| dkr�|r˜tdƒ‚|dƒq<| |vr¢qrˆr’ržÚpackIrvZdecoded_appendZcurrZ curr_appendZ curr_clearÚxrwr?rŽr#r#r$rŽs^ þ      ÿ€      rsU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs4 tdurdd„tDƒadd„tDƒat|tt|ƒS)NcSrDr#rErFr#r#r$rIærJzb85encode..cSr•r#)Ú _b85charsrKr#r#r$rIçrN)Ú _b85chars2Ú _b85alphabetr¬r�)r>r�r#r#r$rÜs rc Cs: tdurdgdattƒD]\}}|t|<qt|ƒ}t|ƒ d}|d|}g}t d¡j}tdt|ƒdƒD]T}|||d…}d}z|D] }|dt|}qGWn t yst|ƒD]\}}t|durqt d||ƒd‚q^‚wz |  ||ƒ¡Wq8tj yŒt d|ƒd‚wd   |¡} |r›| d| …} | S) NérOó~r rrƒz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dr‰)Ú_b85decrnr®r%r3rŠr‹r§r`rrrœr©rŒ) r>rHrcrŽÚoutrªÚchunkrwÚjr?r#r#r$rêsR    ÿ  ÿÿÿûÿÿÿ réLrYrWcCsd | t¡}|s dSt|ƒtkr'| tt|ƒ¡}|sn ||7}t|ƒtkst |¡}| |¡qrA)ÚreadÚ MAXBINSIZEr3r(r)Úwrite)ÚinputÚoutputr"ÚnsÚliner#r#r$rs   ü  örcCs* | ¡}|s dSt |¡}| |¡qrA)Úreadliner(r7r¸)r¹rºr¼r"r#r#r$r)s  ûrc Csˆzt|ƒ}Wnty}z d|jj}t|ƒ|‚d}~ww|jdvr0d|j|jjf}t|ƒ‚|jdkrBd|j|jjf}t|ƒ‚dS)Nz"expected bytes-like object, not %s)rcr>ÚBz-expected single byte elements, not %r from %srUz(expected 1-D data, not %d-D data from %s)rrrr r¥Úndim)r"ÚmÚerrÚmsgr#r#r$Ú_input_type_check2s$   €þ  ÿ  ÿýrÃcCsN t|ƒg}tdt|ƒtƒD]}|||t…}| t |¡¡qd |¡S)Nrr‰)rÃr`r3r·rœr(r)rŒ)r"ÚpiecesrHr³r#r#r$rBs rcCs t|ƒt |¡SrA)rÃr(r7r!r#r#r$rMs rc Cs6 ddl}ddl}z| |jdd…d¡\}}Wn)|jyA}z|j|_t|ƒtd|jdƒ| d¡WYd}~nd}~wwt}|D] \}}|dkrPt}|dkrVt }|dkr\t }|d krft ƒdSqF|r�|dd kr�t |dd ƒ�}|||jj ƒWdƒdS1s‰wYdS||j j |jj ƒdS) NrrUZdeutz�usage: %s [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (default) -t: encode and decode string 'Aladdin:open sesame'r/z-ez-dz-uz-tú-Úrb)ÚsysÚgetoptÚargvr©ÚstderrÚstdoutÚprintÚexitrrÚtestÚopenÚbufferÚstdin) rÇrÈZoptsÚargsrÂÚfuncÚorLÚfr#r#r$ÚmainTs0ý€ù    "ÿrÖcCs<d}tt|ƒƒt|ƒ}tt|ƒƒt|ƒ}tt|ƒƒdS)NsAladdin:open sesame)rÌÚreprrr)Zs0Ús1Ús2r#r#r$rÎns   rÎÚ__main__rA)NF)FN)F)FFF)9r4rŠr(Ú__all__r+r]rr%rrrrr,rBrCrrZ_B32_ENCODE_DOCSTRINGZ_B32_DECODE_DOCSTRINGZ_B32_DECODE_MAP01_DOCSTRINGrzr}r\rmrdrxrr¥Ú__doc__r r r r r r–r™ršr�r�rrr®r¬r­r±rrZ MAXLINESIZEr·rrrÃrrrÖrÎr r#r#r#r$Ús~  ,     $/ ÿ ÿ  )H -    ÿ