Searched refs:altchars (Results 1 – 6 of 6) sorted by relevance
/external/python/cpython2/Lib/ |
D | base64.py | 33 def _translate(s, altchars): argument 35 for k, v in altchars.items(): 43 def b64encode(s, altchars=None): argument 55 if altchars is not None: 56 return encoded.translate(string.maketrans(b'+/', altchars[:2])) 60 def b64decode(s, altchars=None): argument 72 if altchars is not None: 73 s = s.translate(string.maketrans(altchars[:2], '+/'))
|
/external/python/cpython3/Lib/ |
D | base64.py | 51 def b64encode(s, altchars=None): argument 59 if altchars is not None: 60 assert len(altchars) == 2, repr(altchars) 61 return encoded.translate(bytes.maketrans(b'+/', altchars)) 65 def b64decode(s, altchars=None, validate=False): argument 81 if altchars is not None: 82 altchars = _bytes_from_decode_data(altchars) 83 assert len(altchars) == 2, repr(altchars) 84 s = s.translate(bytes.maketrans(altchars, b'+/'))
|
/external/python/cpython3/Lib/test/ |
D | test_base64.py | 141 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=b'*$'), b'01a*b$cd') 142 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=bytearray(b'*$')), 144 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=memoryview(b'*$')), 146 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=array('B', b'*$')), 151 self.assertRaises(TypeError, base64.b64encode, b"", altchars="*$") 202 for (data, altchars), res in tests_altchars.items(): 204 altchars_str = altchars.decode('ascii') 206 eq(base64.b64decode(data, altchars=altchars), res) 207 eq(base64.b64decode(data_str, altchars=altchars), res) 208 eq(base64.b64decode(data, altchars=altchars_str), res) [all …]
|
/external/python/cpython2/Lib/test/ |
D | test_base64.py | 79 eq(base64.b64encode('\xd3V\xbeo\xf7\x1d', altchars='*$'), '01a*b$cd') 83 '\xd3V\xbeo\xf7\x1d', altchars=bytearray('*$')) 118 eq(base64.b64decode('01a*b$cd', altchars='*$'), '\xd3V\xbeo\xf7\x1d')
|
/external/python/cpython2/Doc/library/ |
D | base64.rst | 27 .. function:: b64encode(s[, altchars]) 31 *s* is the string to encode. Optional *altchars* must be a string of at least 40 .. function:: b64decode(s[, altchars]) 44 *s* is the string to decode. Optional *altchars* must be a string of at least
|
/external/python/cpython3/Doc/library/ |
D | base64.rst | 51 .. function:: b64encode(s, altchars=None) 56 Optional *altchars* must be a :term:`bytes-like object` of at least 63 .. function:: b64decode(s, altchars=None, validate=False) 68 Optional *altchars* must be a :term:`bytes-like object` or ASCII string of
|