input: Write a python function to encode an integer to base64 format.
  assert encode_base64(123456) == b'ewA='
  assert encode_base64(1) == b'AQ=='
  assert encode_base64(999999) == b'AAQDDw=='
output: def encode_base64(n):
      import base64
      return base64.b64encode(n.to_bytes((n.bit_length() + 7) // 8, byteorder='big') or b'\0')