Added base64 encoding functionality