added base64 encoding functions