正常base64:
import base64
str1 = "1234567890"
b64_str = base64.b64encode(str1.encode("utf-8")).decode("utf-8")
print(b64_str) ### MTIzNDU2Nzg5MA==
hex base64:
import base64
str1 = "1234567890"
byte_arr = bytes.fromhex(str1)
base64_byte_arr = base64.b64encode(byte_arr).decode("utf-8")
print(base64_byte_arr) ### EjRWeJA=