tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
L\¬Qc@s­dZddlZddlZddlZddddddd    d
d d d dddgZgedƒD]Zeeƒ^qgZdZ    d„Z
dd„Z dd„Z d„Zd„Zd„Zd„Zi dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6ZejƒZejƒgeD]\ZZe^qÍZegejƒD]\ZZeeeƒf^qõƒZdZ„Zedd[„Zd\„Zed]„Zd^Z e d;d3Z!d_„Z"d`„Z#da„Z$db„Z%dc„Z&dd„Z'e(dekr©e&ƒndS(fs/RFC 3548: Base16, Base32, Base64 Data EncodingsiÿÿÿÿNtencodetdecodet encodestringt decodestringt    b64encodet    b64decodet    b32encodet    b32decodet    b16encodet    b16decodetstandard_b64encodetstandard_b64decodeturlsafe_b64encodeturlsafe_b64decodeitcCsJt}x*|jƒD]\}}||t|ƒ<qW|jdj|ƒƒS(NR(t _translationtitemstordt    translatetjoin(tstaltcharst translationtktv((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyt
_translate scCsFtj|ƒd }|dk    rBt|i|dd6|dd6ƒS|S(slEncode 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.
    iÿÿÿÿit+it/N(tbinasciit
b2a_base64tNoneR(RRtencoded((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR*s  #cCsn|dk    r4t|id|d6d|d6ƒ}nytj|ƒSWn"tjk
ri}t|ƒ‚nXdS(sž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.
    RiRiN(RRRt
a2b_base64tErrort    TypeError(RRtmsg((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR;s (cCs
t|ƒS(syEncode a string using the standard Base64 alphabet.
 
    s is the string to encode.  The encoded string is returned.
    (R(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR
OscCs
t|ƒS(sDecode 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.
    (R(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR VscCs t|dƒS(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 '/'.
    s-_(R(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR _scCs t|dƒS(sDDecode 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 '/'.
    s-_(R(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR gs    tAitJi    tSit3itBitKi
tTit4itCitLi tUit5itDitMi tVit6itEitNi tWit7itFitOitXitGitPitYitHitQitZitIitRit2ic     Cs—g}tt|ƒdƒ\}}|rF|dd|7}|d7}nxÛt|ƒD]Í}tjd||d|dd!ƒ\}}}||d@d>7}||d@d>7}|jt|d?t|d    ?d
@t|d?d
@t|d ?t|d ?d
@t|d ?d
@t|d?t|d
@gƒqSWtj|ƒ}|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 iiiúÿÿÿs======iüÿÿÿs====iýÿÿÿs===iiÿÿÿÿt=(    tdivmodtlentrangetstructtunpacktextendt_b32tabt EMPTYSTRINGR(    Rtpartstquantatleftovertitc1tc2tc3R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR‡s6 .          c Cs tt|ƒdƒ\}}|r0tdƒ‚n|rVt|idd6|d6ƒ}n|rk|jƒ}nd}tjd|ƒ}|r»t|jdƒƒ}|dkr»||  }q»ng}d}d    }    x‰|D]}
tj    |
ƒ} | dkrtd
ƒ‚n|t|
|    >7}|    d 8}    |    dkrÔ|j t j d |ƒƒd}d    }    qÔqÔWt j d |ƒ} |dkrd } 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<pad>[=]*)$tpadi#sNon-base32 digit foundis%010xRiiÿÿÿÿiiþÿÿÿiiýÿÿÿiiüÿÿÿN(RFRGR"Rtuppertretsearchtgroupt_b32revtgetRtappendRt    unhexlifyRMR( Rtcasefoldtmap01RORPtpadcharstmoRNtacctshifttctvaltlast((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR±sP    
                 cCstj|ƒjƒS(scEncode a string using Base16.
 
    s is the string to encode.  The encoded string is returned.
    (RthexlifyRX(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyRûscCsC|r|jƒ}ntjd|ƒr6tdƒ‚ntj|ƒ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`((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR    s
iLcCsŒx…tr‡|jtƒ}|s"PnxCt|ƒtkrg|jtt|ƒƒ}|sZPn||7}q%Wtj|ƒ}|j|ƒqWdS(sEncode a file.N(tTruetreadt
MAXBINSIZERGRRtwrite(tinputtoutputRtnstline((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyRs    cCsCx<tr>|jƒ}|sPntj|ƒ}|j|ƒqWdS(sDecode a file.N(RjtreadlineRR Rm(RnRoRqR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR,s      cCs]g}xGtdt|ƒtƒD]-}|||t!}|jtj|ƒƒqWdj|ƒS(s4Encode a string into multiple lines of base-64 data.iR(RHRGRlR^RRR(RtpiecesRQtchunk((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR6s
cCs tj|ƒS(sDecode a string.(RR (R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR?sc    CsQddl}ddl}y#|j|jddƒ\}}WnD|jk
r}|j|_|GHd|jdGH|jdƒnXt}xj|D]b\}}|dkr°t}n|d    krÅt}n|d
krÚt}n|d krt    ƒdSqW|r:|dd kr:t
|dd ƒ}|||jƒWdQXn||j |jƒdS(sSmall test programiÿÿÿÿNitdeutsusage: %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( tsystgetopttargvterrortstderrtstdouttexitRRttest1topentstdin(    RxRytoptstargsR#tfunctotatf((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyttestFs.#              cCs5d}t|ƒ}t|ƒ}|Gt|ƒG|GHdS(NsAladdin:open sesame(RRtrepr(ts0ts1ts2((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyR`s  t__main__()t__doc__RYRIRt__all__RHt_xtchrRRMRRRRR
R R R t _b32alphabetRRLtsortRRtdicttlongR\RtFalseRRR    t MAXLINESIZERlRRRRRˆRt__name__(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/base64.pyt<module>sZ      %    
                      
7    *J