I’m not sure you would really want to do this, but if you do, you could try using an Export Mapping to convert the entity to a JSON string, then Base64 encode this.
Hope this helps
The community commons has two functions: Base64DecodeToFile and Base64EncodeFile for either coding or decoding to base64.
Reagards,
Ronald