encode_bin function

Encode a binary file in a base64 string