1try: 2 try: 3 import ubinascii as binascii 4 except ImportError: 5 import binascii 6except ImportError: 7 print("SKIP") 8 raise SystemExit 9 10print(binascii.b2a_base64(b"")) 11print(binascii.b2a_base64(b"f")) 12print(binascii.b2a_base64(b"fo")) 13print(binascii.b2a_base64(b"foo")) 14print(binascii.b2a_base64(b"foob")) 15print(binascii.b2a_base64(b"fooba")) 16print(binascii.b2a_base64(b"foobar")) 17 18print(binascii.b2a_base64(b"\x00\x01\x02\x03\x04\x05\x06\x07")) 19print(binascii.b2a_base64(b"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f")) 20print(binascii.b2a_base64(b"\x7f\x80\xff")) 21print(binascii.b2a_base64(b"1234ABCDabcd")) 22print(binascii.b2a_base64(b"\x00\x00>")) # convert into '+' 23