call optional base64 encoding hook