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

Function _encode_base64

Lib/email/contentmanager.py:136–142  ·  view source on GitHub ↗
(data, max_line_length)

Source from the content-addressed store, hash-verified

134# drop both this and quoprimime.body_encode in favor of enhanced binascii
135# routines that accepted a max_line_length parameter.
136def _encode_base64(data, max_line_length):
137 encoded_lines = []
138 unencoded_bytes_per_line = max_line_length // 4 * 3
139 for i in range(0, len(data), unencoded_bytes_per_line):
140 thisline = data[i:i+unencoded_bytes_per_line]
141 encoded_lines.append(binascii.b2a_base64(thisline).decode('ascii'))
142 return ''.join(encoded_lines)
143
144
145def _encode_text(string, charset, cte, policy):

Callers 2

_encode_textFunction · 0.70
set_bytes_contentFunction · 0.70

Calls 4

lenFunction · 0.85
appendMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected