(s)
| 125 | return binascii.b2a_base64(s, wrapcol=maxlinelength, newline=False) |
| 126 | |
| 127 | def _decode_base64(s): |
| 128 | if isinstance(s, str): |
| 129 | return binascii.a2b_base64(s.encode("utf-8")) |
| 130 | |
| 131 | else: |
| 132 | return binascii.a2b_base64(s) |
| 133 | |
| 134 | # Contents should conform to a subset of ISO 8601 |
| 135 | # (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'. Smaller units |