(e)
| 213 | |
| 214 | |
| 215 | def b64Encode(e): |
| 216 | P = len(e) |
| 217 | W = P % 3 |
| 218 | U = [] |
| 219 | z = 16383 |
| 220 | H = 0 |
| 221 | Z = P - W |
| 222 | while H < Z: |
| 223 | U.append(encodeChunk(e, H, Z if H + z > Z else H + z)) |
| 224 | H += z |
| 225 | if 1 == W: |
| 226 | F = e[P - 1] |
| 227 | U.append(lookup[F >> 2] + lookup[(F << 4) & 63] + "==") |
| 228 | elif 2 == W: |
| 229 | F = (e[P - 2] << 8) + e[P - 1] |
| 230 | U.append(lookup[F >> 10] + lookup[63 & (F >> 4)] + |
| 231 | lookup[(F << 2) & 63] + "=") |
| 232 | return "".join(U) |
| 233 | |
| 234 | |
| 235 | def encodeUtf8(e): |