usr/bin/base64000075500000110760147207341240007150 0ustar00ELF>I@@p@8 @@@@@@88@8@@@tt ||`|` }}`}`TT@T@DDPtddd@d@QtdRtd||`|`88/lib64/ld-linux-x86-64.so.2GNU GNU,G< PFUe0GMCRQ.'e' IW n&_@8.^vzlibc.so.6fflushstrcpy__printf_chksetlocalembrtowcfopenstrncmpoptindstrrchrdcgettexterror__stack_chk_failiswprintreallocabortstdin_exitmemchrprogram_invocation_name__assert_fail__ctype_get_mb_cur_maxposix_fadvisecallocstrlenungetcfread_unlockedmemset__errno_locationmemcmp__fprintf_chkstdoutlseekmemcpyfclosemallocmbsinit__uflownl_langinfo__ctype_b_locgetenvoptarg__freadingstderrfscanfgetopt_longfilenofwrite__fpendingstrchrprogram_invocation_short_namefdopenmemmovebindtextdomainfwrite_unlockedstrcmp__libc_start_mainfseeko__overflow__strtoul_internalfputs_unlockedfree__progname__progname_full__cxa_atexit__gmon_start__GLIBC_2.3GLIBC_2.3.4GLIBC_2.14GLIBC_2.4GLIBC_2.2.5ii ti ii ui `` ``(`)`+`B`E` `(`0`8`@`H` P` X` `` h`p`x``````````Ȁ`Ѐ`؀```` `!`"`#`$`% `&(`'0`)8`*@`,H`-P`.X`/``0h`1p`2x`3`4`5`6`7`8`:`;`<`=ȁ`>Ё`?؁`@`A`C`DHHMl HtKH5bl %dl @%bl h%Zl h%Rl h%Jl h%Bl h%:l h%2l h%*l hp%"l h`%l h P%l h @% l h 0%l h %k h %k h%k h%k h%k h%k h%k h%k h%k h%k h%k hp%k h`%k hP%k h@%k h0%k h %zk h%rk h%jk h%bk h %Zk h!%Rk h"%Jk h#%Bk h$%:k h%%2k h&%*k h'p%"k h(`%k h)P%k h*@% k h+0%k h, %j h-%j h.%j h/%j h0%j h1%j h2%j h3%j h4%j h5%j h6%j h7p%j h8`%j h9P%j h:@%j h;0AWAVAUE1ATE1USHHH>dH%(HD$1H$LIH5HH5Z?H=E?H=9?tH= >H d Hg?E1Hމd=}tx=~1iwL=g E111LI?E3tI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\f.AWAVAUATUSHdH%(H$1BL51 HHHwHDMuLIlH{LtA.@t)LHt @*uA~uLII\;H@HDH$dH3 %(H?HĨ[]A\A]A^A_H=HIt 8gL= A A</A$.MI}'HHLLH$tBD%/IHcharset.IEsAEaliafAE H1AH5%HIHD$`Ld$ H$HD$fIGI;G?HPIW8 tGvڃ#LHL$H51LLL H!%tLT$DHJHDHL)A I!%tDIJLDIL+T$H<$I&HHHxHT$LT$H $LT$HT$IM:L4$HLH)M)LLsHt$K|5MaIGI;GL۾DpL5 HѾL5. E1$H~HItH@DtIGI;GHPIW u݃LH$HwAtH$LLT$HT$HHHpH $LT$IHT$L5 GNU coreutilsen_/usr/share/localeinvalid wrap size: %sSimon Josefssonbase64diw:extra operand %srbclosing standard inputdecodewrapignore-garbagehelpversionTry '%s --help' for more information. Usage: %s [OPTION]... [FILE] Base64 encode or decode FILE, or standard input, to standard output. Mandatory arguments to long options are mandatory for short options too. -d, --decode decode data -i, --ignore-garbage when decoding, ignore non-alphabet characters -w, --wrap=COLS wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping --help display this help and exit --version output version information and exit With no FILE, or when FILE is -, read standard input. The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain newlines in addition to the bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the encoded stream. http://www.gnu.org/software/coreutils/Report %s translation bugs to For complete documentation, run: info coreutils '%s invocation' 8.22>?456789:;<=  !"#$%&'()*+,-./0123ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/%s: %sA NULL argv[0] was passed through an exec system call. /.libs/lt-’'"e‘`literalshellshell-alwaysc-maybeescapeclocale@@@@<$$$$$$, $$$$$$$$$$$$$$$$$$D$%s (%s) %s %s %s (C)Written by %s. Written by %s and %s. Written by %s, %s, and %s. Report bugs to: %s bug-coreutils@gnu.org%s home page: <%s> License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by %s, %s, %s, and %s. Written by %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, %s, %s, %s, and others. General help using GNU software: hhXCopyright %s %d Free Software Foundation, Inc.memory exhaustedlib/xstrtol.c0 <= strtol_base && strtol_base <= 36By:yxstrtoumax/usr/lib64ASCIICHARSETALIASDIR%50s %50s;QخxXHX0xHP(X0Hhx8Hh8(( 0 H ` x h  X p x  ( @ X p 8 P Hp ( H@ X p ( H x H`x08zRx ɲ*zRx $FJ w?;*3$"LDhBEB E(A0A8G9b 8A0A(B BBBA L7BEB E(D0D8I 8A0A(B BBBA $BBA C(D04 ЮBBB E(D0C8GP$DHD I LlBPG A(O@W (A ABBJ s(D ABB L(BBB B(D0D8DP 8C0A(B BBBH $L<BEE E(A0A8DpY 8A0A(B BBBF DBEE D(D0GPj 0A(A BBBC h`,XAAD } AAA 4iL@+AZ E JlPH"FNXD{ A DPz A <XBGG F(D0Q (D ABBD L$( BEE E(A0A8J 8A0A(B BBBG LtBEB B(A0A8Gm 8D0A(B BBBB ,2BAD gAB $6<@TH4Kc A DthBLE E(A0A8G`S8A0A(B BBBLBIE E(D0A8G8A0A(B BBB @ ,$8BND jALTl   4WBDC D`@  AABA <ZBED C(Dp| (A ABBA , D4\BLD D`  AABA 80 ( < BED C(Dp (A ABBA  4Ld | x p hBBB B(D0D8G 8A0A(B BBBE  8A0A(B BBBB b 8G0A(B BBBV ^ 8G0A(M BBBO b 8P0A(B BBBU t X  `Dp} A  G A  `A} AN A  [$ $< 8DS I M A d #^| b] XMH AQ DN A $ (AGG IGA AP4 8KLL lBBE B(A0A8D`| 8A0A(B BBBI 4 xBAA F ABC `AB (@DR J [, HeAG N DF CAD$ vBAD p ABF W ABF RABLl 5BGB B(A0A8G 8A0A(B BBBA D eBEE E(H0H8M@l8A0A(B BBB  @@W@dW@wW@iW@~W@}]@]@]@c@]@]@)W@]@ @ V@|`|`o@H @@  ` @ @ o @oo0 @}`@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@[@p``base64.debug=n7zXZִF!t/oz]?Eh=ڊ̓N7I'(ޓ\ײ.3f~WI[4 BvKsl[MX.i;˭p2~/gU'5@M~Ἒ1iH&ΏK bg jFk XM'k7L >^#*=G+Coes=tTiXrrǯrYyXB] %9ʭe%ѵf?5A4L0W "*:&Y~GomJ"ӦOW/OS+Ʃ6~5`z~jy*p=U@{i6iB0ΐT-ndZl !ge*[1X ji q~֒|`n2XQ ,O]QRu0cxdJ`,h8#'ݨlr ʿ^ 2^;\zG*\ptekiKl Xyp(,-g,0~mV>yKA2>3'/ͥ77Zw7'ԗdgHrYHODE; M.r+2fW6>l$z3{*#:4ykV\ C<.#?ʼni\'j i>xbk&F$bj?;E3'kt")-(ϫ@!GR)شQ~#CGK ˩)np #}Ypؓ %%3]F2"ˑȖJa[ZDoۡH2 {#=6M^/ 8H,:C[>X=t&|la0~09\,fdwR3"\˰՞xǺgXAUeRTRZN rY`^BڶjĠ&Ǿ1ߑ6]z/L٘Zev4/$aȴ'aȭ۔7׶pG/ 2|D @FH @H No0 @0 [o @ `j @ tB @ ~@y@p@p*?V@V V@V d@d`g@`gd |`||`||`||`| }`}`@`` ``  P__init__.py000064400000003063147651064330006670 0ustar00# -*- coding: utf-8 -*- # # Copyright (c) 2010 Red Hat, Inc # # This file is part of kitchen # # kitchen is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # kitchen is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for # more details. # # You should have received a copy of the GNU Lesser General Public License # along with kitchen; if not, see # # Authors: # Toshio Kuratomi ''' Implement the modern base64 interface. Python-2.4 and above have a new API for the base64 module. This is a backport of that module for use on python-2.3. .. seealso:: :mod:`base64` for information about using the functions provided here. ''' import sys # :W0401,W0614: The purpose of this module is to create a backport of base64 # so we ignore these pylint warnings #pylint:disable-msg=W0401,W0614 if sys.version_info >= (2, 4): from base64 import * else: from kitchen.pycompat24.base64._base64 import * __all__ = ( 'b16decode', 'b16encode', 'b32decode', 'b32encode', 'b64decode', 'b64encode', 'decode', 'decodestring', 'encode', 'encodestring', 'standard_b64decode', 'standard_b64encode', 'urlsafe_b64decode', 'urlsafe_b64encode',) _base64.py000064400000026215147651064330006360 0ustar00#! /usr/bin/env python """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support import re import struct import binascii __all__ = [ # Legacy interface exports traditional RFC 1521 Base64 encodings 'encode', 'decode', 'encodestring', 'decodestring', # Generalized interface for other encodings 'b64encode', 'b64decode', 'b32encode', 'b32decode', 'b16encode', 'b16decode', # Standard Base64 encoding 'standard_b64encode', 'standard_b64decode', # Some common Base64 alternatives. As referenced by RFC 3458, see thread # starting at: # # http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html 'urlsafe_b64encode', 'urlsafe_b64decode', ] _translation = [chr(_x) for _x in range(256)] EMPTYSTRING = '' def _translate(s, altchars): translation = _translation[:] for k, v in altchars.items(): translation[ord(k)] = v return s.translate(''.join(translation)) # Base64 encoding/decoding uses binascii def b64encode(s, altchars=None): """Encode a string using Base64. s is the string to encode. Optional altchars must be a string of at least length 2 (additional characters are ignored) which specifies an alternative alphabet for the '+' and '/' characters. This allows an application to e.g. generate url or filesystem safe Base64 strings. The encoded string is returned. """ # Strip off the trailing newline encoded = binascii.b2a_base64(s)[:-1] if altchars is not None: return _translate(encoded, {'+': altchars[0], '/': altchars[1]}) return encoded def b64decode(s, altchars=None): """Decode a Base64 encoded string. s is the string to decode. Optional altchars must be a string of at least length 2 (additional characters are ignored) which specifies the alternative alphabet used instead of the '+' and '/' characters. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. """ if altchars is not None: s = _translate(s, {altchars[0]: '+', altchars[1]: '/'}) try: return binascii.a2b_base64(s) except binascii.Error, msg: # Transform this exception for consistency raise TypeError(msg) def standard_b64encode(s): """Encode a string using the standard Base64 alphabet. s is the string to encode. The encoded string is returned. """ return b64encode(s) def standard_b64decode(s): """Decode a string encoded with the standard Base64 alphabet. s is the string to decode. The decoded string is returned. A TypeError is raised if the string is incorrectly padded or if there are non-alphabet characters present in the string. """ return b64decode(s) def urlsafe_b64encode(s): """Encode a string using a url-safe Base64 alphabet. s is the string to encode. The encoded string is returned. The alphabet uses '-' instead of '+' and '_' instead of '/'. """ return b64encode(s, '-_') def urlsafe_b64decode(s): """Decode a string encoded with the standard Base64 alphabet. s is the string to decode. The decoded string is returned. A TypeError is raised if the string is incorrectly padded or if there are non-alphabet characters present in the string. The alphabet uses '-' instead of '+' and '_' instead of '/'. """ return b64decode(s, '-_') # Base32 encoding/decoding must be done in Python _b32alphabet = { 0: 'A', 9: 'J', 18: 'S', 27: '3', 1: 'B', 10: 'K', 19: 'T', 28: '4', 2: 'C', 11: 'L', 20: 'U', 29: '5', 3: 'D', 12: 'M', 21: 'V', 30: '6', 4: 'E', 13: 'N', 22: 'W', 31: '7', 5: 'F', 14: 'O', 23: 'X', 6: 'G', 15: 'P', 24: 'Y', 7: 'H', 16: 'Q', 25: 'Z', 8: 'I', 17: 'R', 26: '2', } _b32tab = _b32alphabet.items() _b32tab.sort() _b32tab = [v for k, v in _b32tab] _b32rev = dict([(v, long(k)) for k, v in _b32alphabet.items()]) def b32encode(s): """Encode a string using Base32. s is the string to encode. The encoded string is returned. """ parts = [] quanta, leftover = divmod(len(s), 5) # Pad the last quantum with zero bits if necessary if leftover: s += ('\0' * (5 - leftover)) quanta += 1 for i in range(quanta): # c1 and c2 are 16 bits wide, c3 is 8 bits wide. The intent of this # code is to process the 40 bits in units of 5 bits. So we take the 1 # leftover bit of c1 and tack it onto c2. Then we take the 2 leftover # bits of c2 and tack them onto c3. The shifts and masks are intended # to give us values of exactly 5 bits in width. c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5]) c2 += (c1 & 1) << 16 # 17 bits wide c3 += (c2 & 3) << 8 # 10 bits wide parts.extend([_b32tab[c1 >> 11], # bits 1 - 5 _b32tab[(c1 >> 6) & 0x1f], # bits 6 - 10 _b32tab[(c1 >> 1) & 0x1f], # bits 11 - 15 _b32tab[c2 >> 12], # bits 16 - 20 (1 - 5) _b32tab[(c2 >> 7) & 0x1f], # bits 21 - 25 (6 - 10) _b32tab[(c2 >> 2) & 0x1f], # bits 26 - 30 (11 - 15) _b32tab[c3 >> 5], # bits 31 - 35 (1 - 5) _b32tab[c3 & 0x1f], # bits 36 - 40 (1 - 5) ]) encoded = EMPTYSTRING.join(parts) # Adjust for any leftover partial quanta if leftover == 1: return encoded[:-6] + '======' elif leftover == 2: return encoded[:-4] + '====' elif leftover == 3: return encoded[:-3] + '===' elif leftover == 4: return encoded[:-1] + '=' return encoded def b32decode(s, casefold=False, map01=None): """Decode a Base32 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. 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. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. """ quanta, leftover = divmod(len(s), 8) if leftover: raise TypeError('Incorrect padding') # Handle section 2.4 zero and one mapping. The flag map01 will be either # False, or the character to map the digit 1 (one) to. It should be # either L (el) or I (eye). if map01: s = _translate(s, {'0': 'O', '1': map01}) if casefold: s = s.upper() # Strip off pad characters from the right. We need to count the pad # characters because this will tell us how many null bytes to remove from # the end of the decoded string. padchars = 0 mo = re.search('(?P[=]*)$', s) if mo: padchars = len(mo.group('pad')) if padchars > 0: s = s[:-padchars] # Now decode the full quanta parts = [] acc = 0 shift = 35 for c in s: val = _b32rev.get(c) if val is None: raise TypeError('Non-base32 digit found') acc += _b32rev[c] << shift shift -= 5 if shift < 0: parts.append(binascii.unhexlify('%010x' % acc)) acc = 0 shift = 35 # Process the last, partial quanta last = binascii.unhexlify('%010x' % acc) if padchars == 0: last = '' # No characters elif padchars == 1: last = last[:-1] elif padchars == 3: last = last[:-2] elif padchars == 4: last = last[:-3] elif padchars == 6: last = last[:-4] else: raise TypeError('Incorrect padding') parts.append(last) return EMPTYSTRING.join(parts) # RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns # lowercase. The RFC also recommends against accepting input case # insensitively. def b16encode(s): """Encode a string using Base16. s is the string to encode. The encoded string is returned. """ return binascii.hexlify(s).upper() def b16decode(s, casefold=False): """Decode a Base16 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. """ if casefold: s = s.upper() if re.search('[^0-9A-F]', s): raise TypeError('Non-base16 digit found') return binascii.unhexlify(s) # Legacy interface. This code could be cleaned up since I don't believe # binascii has any line length limitations. It just doesn't seem worth it # though. MAXLINESIZE = 76 # Excluding the CRLF MAXBINSIZE = (MAXLINESIZE//4)*3 def encode(input, output): """Encode a file.""" while True: s = input.read(MAXBINSIZE) if not s: break while len(s) < MAXBINSIZE: ns = input.read(MAXBINSIZE-len(s)) if not ns: break s += ns line = binascii.b2a_base64(s) output.write(line) def decode(input, output): """Decode a file.""" while True: line = input.readline() if not line: break s = binascii.a2b_base64(line) output.write(s) def encodestring(s): """Encode a string into multiple lines of base-64 data.""" pieces = [] for i in range(0, len(s), MAXBINSIZE): chunk = s[i : i + MAXBINSIZE] pieces.append(binascii.b2a_base64(chunk)) return "".join(pieces) def decodestring(s): """Decode a string.""" return binascii.a2b_base64(s) # Useable as a script... def test(): """Small test program""" import sys, getopt try: opts, args = getopt.getopt(sys.argv[1:], 'deut') except getopt.error, msg: sys.stdout = sys.stderr print msg print """usage: %s [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (default) -t: encode and decode string 'Aladdin:open sesame'"""%sys.argv[0] sys.exit(2) func = encode for o, a in opts: if o == '-e': func = encode if o == '-d': func = decode if o == '-u': func = decode if o == '-t': test1(); return if args and args[0] != '-': fh = open(args[0], 'rb') try: func(fh, sys.stdout) finally: fh.close() else: func(sys.stdin, sys.stdout) def test1(): s0 = "Aladdin:open sesame" s1 = encodestring(s0) s2 = decodestring(s1) print s0, repr(s1), s2 if __name__ == '__main__': test() __init__.pyc000064400000001667147651064330007043 0ustar00 i:Oc@sBdZddlZejdkr.ddlTn ddlTdZdS(s Implement the modern base64 interface. Python-2.4 and above have a new API for the base64 module. This is a backport of that module for use on python-2.3. .. seealso:: :mod:`base64` for information about using the functions provided here. iNii(t*t b16decodet b16encodet b32decodet b32encodet b64decodet b64encodetdecodet decodestringtencodet encodestringtstandard_b64decodetstandard_b64encodeturlsafe_b64decodeturlsafe_b64encode(ii(RRRRRRsdecodeRsencodeR R R R R(t__doc__tsyst version_infotbase64t!kitchen.pycompat24.base64._base64t__all__(((sF/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/__init__.pyt s   __init__.pyo000064400000001667147651064330007057 0ustar00 i:Oc@sBdZddlZejdkr.ddlTn ddlTdZdS(s Implement the modern base64 interface. Python-2.4 and above have a new API for the base64 module. This is a backport of that module for use on python-2.3. .. seealso:: :mod:`base64` for information about using the functions provided here. iNii(t*t b16decodet b16encodet b32decodet b32encodet b64decodet b64encodetdecodet decodestringtencodet encodestringtstandard_b64decodetstandard_b64encodeturlsafe_b64decodeturlsafe_b64encode(ii(RRRRRRsdecodeRsencodeR R R R R(t__doc__tsyst version_infotbase64t!kitchen.pycompat24.base64._base64t__all__(((sF/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/__init__.pyt s   _base64.pyc000064400000026536147651064330006531 0ustar00 i:Oc@sdZddlZddlZddlZddddddd d d d d dddgZgedD]Zee^qgZdZ dZ ddZ ddZ dZdZdZdZi dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6ZejZejgeD]\ZZe^qZegejD]\ZZeeef^qZdZZedd[Zd\Zed]Zd^Z e d;d3Z!d_Z"d`Z#daZ$dbZ%dcZ&ddZ'e(dekre&ndS(fs/RFC 3548: Base16, Base32, Base64 Data EncodingsiNtencodetdecodet encodestringt decodestringt b64encodet b64decodet b32encodet b32decodet b16encodet b16decodetstandard_b64encodetstandard_b64decodeturlsafe_b64encodeturlsafe_b64decodeitcCsJt}x*|jD]\}}||t|7}||d@d>7}|jt|d?t|d ?d @t|d?d @t|d ?t|d ?d @t|d ?d @t|d?t|d @gqSWtj|}|dkrK|d dS|d krc|d dS|dkr{|d dS|dkr|d dS|S(scEncode a string using Base32. s is the string to encode. The encoded string is returned. itis!HHBiiii iii iiis======is====is===iit=( tdivmodtlentrangetstructtunpacktextendt_b32tabt EMPTYSTRINGR( Rtpartstquantatleftovertitc1tc2tc3R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRs6 .          c Cs tt|d\}}|r0tdn|rVt|idd6|d6}n|rk|j}nd}tjd|}|rt|jd}|dkr|| }qng}d}d } x|D]} tj | } | dkrtd n|t| | >7}| d 8} | dkr|j t j d |d}d } qqWt j d |} |dkrd } np|dkr| d } nW|dkr| d } n>|dkr| d } n%|dkr| d } n td|j | tj|S(sGDecode a Base32 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. 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. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. isIncorrect paddingR9t0t1is(?P[=]*)$tpadi#sNon-base32 digit foundis%010xRiiiiiiiiN(RFRGR"Rtuppertretsearchtgroupt_b32revtgetRtappendRt unhexlifyRMR( Rtcasefoldtmap01RORPtpadcharstmoRNtacctshifttctvaltlast((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRsP                   cCstj|jS(scEncode a string using Base16. s is the string to encode. The encoded string is returned. (RthexlifyRX(R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRscCsC|r|j}ntjd|r6tdntj|S(swDecode a Base16 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. s [^0-9A-F]sNon-base16 digit found(RXRYRZR"RR_(RR`((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR s iLcCsxtr|jt}|s"PnxCt|tkrg|jtt|}|sZPn||7}q%Wtj|}|j|qWdS(sEncode a file.N(tTruetreadt MAXBINSIZERGRRtwrite(tinputtoutputRtnstline((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRs cCsCx<tr>|j}|sPntj|}|j|qWdS(sDecode a file.N(RjtreadlineRR Rm(RnRoRqR((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR,s   cCs]g}xGtdt|tD]-}|||t!}|jtj|qWdj|S(s4Encode a string into multiple lines of base-64 data.iR(RHRGRlR^RRR(RtpiecesRQtchunk((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR6s cCs tj|S(sDecode a string.(RR (R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR?sc CsZddl}ddl}y#|j|jdd\}}WnD|jk r}|j|_|GHd|jdGH|jdnXt}xj|D]b\}}|dkrt}n|d krt}n|d krt}n|d krt dSqW|rC|dd krCt |dd }z|||jWd|j Xn||j |jdS(sSmall test programiNitdeutsusage: %s [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (default) -t: encode and decode string 'Aladdin:open sesame'iis-es-ds-us-tt-trb( tsystgetopttargvterrortstderrtstdouttexitRRttest1topentclosetstdin( RxRytoptstargsR#tfunctotatfh((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyttestFs2#     cCs5d}t|}t|}|Gt|G|GHdS(NsAladdin:open sesame(RRtrepr(ts0ts1ts2((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRcs  t__main__()t__doc__RYRIRt__all__RHt_xtchrRRMRRRRR R R R t _b32alphabetRRLtsortRRtdicttlongR\RtFalseRRR t MAXLINESIZERlRRRRRRt__name__(((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pytsZ      %       7 *J       _base64.pyo000064400000026536147651064330006545 0ustar00 i:Oc@sdZddlZddlZddlZddddddd d d d d dddgZgedD]Zee^qgZdZ dZ ddZ ddZ dZdZdZdZi dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6ZejZejgeD]\ZZe^qZegejD]\ZZeeef^qZdZZedd[Zd\Zed]Zd^Z e d;d3Z!d_Z"d`Z#daZ$dbZ%dcZ&ddZ'e(dekre&ndS(fs/RFC 3548: Base16, Base32, Base64 Data EncodingsiNtencodetdecodet encodestringt decodestringt b64encodet b64decodet b32encodet b32decodet b16encodet b16decodetstandard_b64encodetstandard_b64decodeturlsafe_b64encodeturlsafe_b64decodeitcCsJt}x*|jD]\}}||t|7}||d@d>7}|jt|d?t|d ?d @t|d?d @t|d ?t|d ?d @t|d ?d @t|d?t|d @gqSWtj|}|dkrK|d dS|d krc|d dS|dkr{|d dS|dkr|d dS|S(scEncode a string using Base32. s is the string to encode. The encoded string is returned. itis!HHBiiii iii iiis======is====is===iit=( tdivmodtlentrangetstructtunpacktextendt_b32tabt EMPTYSTRINGR( Rtpartstquantatleftovertitc1tc2tc3R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRs6 .          c Cs tt|d\}}|r0tdn|rVt|idd6|d6}n|rk|j}nd}tjd|}|rt|jd}|dkr|| }qng}d}d } x|D]} tj | } | dkrtd n|t| | >7}| d 8} | dkr|j t j d |d}d } qqWt j d |} |dkrd } np|dkr| d } nW|dkr| d } n>|dkr| d } n%|dkr| d } n td|j | tj|S(sGDecode a Base32 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. 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. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. isIncorrect paddingR9t0t1is(?P[=]*)$tpadi#sNon-base32 digit foundis%010xRiiiiiiiiN(RFRGR"Rtuppertretsearchtgroupt_b32revtgetRtappendRt unhexlifyRMR( Rtcasefoldtmap01RORPtpadcharstmoRNtacctshifttctvaltlast((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRsP                   cCstj|jS(scEncode a string using Base16. s is the string to encode. The encoded string is returned. (RthexlifyRX(R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRscCsC|r|j}ntjd|r6tdntj|S(swDecode a Base16 encoded string. s is the string to decode. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. The decoded string is returned. A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string. s [^0-9A-F]sNon-base16 digit found(RXRYRZR"RR_(RR`((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR s iLcCsxtr|jt}|s"PnxCt|tkrg|jtt|}|sZPn||7}q%Wtj|}|j|qWdS(sEncode a file.N(tTruetreadt MAXBINSIZERGRRtwrite(tinputtoutputRtnstline((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRs cCsCx<tr>|j}|sPntj|}|j|qWdS(sDecode a file.N(RjtreadlineRR Rm(RnRoRqR((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR,s   cCs]g}xGtdt|tD]-}|||t!}|jtj|qWdj|S(s4Encode a string into multiple lines of base-64 data.iR(RHRGRlR^RRR(RtpiecesRQtchunk((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR6s cCs tj|S(sDecode a string.(RR (R((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyR?sc CsZddl}ddl}y#|j|jdd\}}WnD|jk r}|j|_|GHd|jdGH|jdnXt}xj|D]b\}}|dkrt}n|d krt}n|d krt}n|d krt dSqW|rC|dd krCt |dd }z|||jWd|j Xn||j |jdS(sSmall test programiNitdeutsusage: %s [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (default) -t: encode and decode string 'Aladdin:open sesame'iis-es-ds-us-tt-trb( tsystgetopttargvterrortstderrtstdouttexitRRttest1topentclosetstdin( RxRytoptstargsR#tfunctotatfh((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyttestFs2#     cCs5d}t|}t|}|Gt|G|GHdS(NsAladdin:open sesame(RRtrepr(ts0ts1ts2((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pyRcs  t__main__()t__doc__RYRIRt__all__RHt_xtchrRRMRRRRR R R R t _b32alphabetRRLtsortRRtdicttlongR\RtFalseRRR t MAXLINESIZERlRRRRRRt__name__(((sE/usr/lib/python2.7/site-packages/kitchen/pycompat24/base64/_base64.pytsZ      %       7 *J