I want to encode an integer into a short string using Base64 and return the value to Open Refine (Google Refine).
I found examples but they always give me an error.
import base64
foo = base64.b64encode('1')
return foo
works returning "MQ=="
But I want to encode the integer 1. The folowing code gives me an error.
import base64
foo = base64.b64encode(bytes([1]))
return foo
The example I found is here: How to encode integer in to base64 string in python 3