Some code for converting to base64. need to test with eman