MCPcopy Index your code
hub / github.com/RustPython/RustPython / _encode_base64

Function _encode_base64

Lib/plistlib.py:124–131  ·  view source on GitHub ↗
(s, maxlinelength=76)

Source from the content-addressed store, hash-verified

122 r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
123
124def _encode_base64(s, maxlinelength=76):
125 # copied from base64.encodebytes(), with added maxlinelength argument
126 maxbinsize = (maxlinelength//4)*3
127 pieces = []
128 for i in range(0, len(s), maxbinsize):
129 chunk = s[i : i + maxbinsize]
130 pieces.append(binascii.b2a_base64(chunk))
131 return b''.join(pieces)
132
133def _decode_base64(s):
134 if isinstance(s, str):

Callers 1

write_bytesMethod · 0.70

Calls 3

lenFunction · 0.85
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected