# C# Signature Sample Code

> C# sample code for the HMAC-SHA1 signature (Base64) that DolphinSOE API requests sign with your appSecret.

Source: https://soe.dolphinvoice.ai/en/docs/sdk/signature_cs

```c#
public static string HMACSHA1Text(string stringToSign,string appSecret)
{
    HMACSHA1 hmacsha1 = new HMACSHA1();
    hmacsha1.Key = System.Text.Encoding.UTF8.GetBytes(appSecret);
    byte[] dataBuffer = System.Text.Encoding.UTF8.GetBytes(stringToSign);
    byte[] hashBytes = hmacsha1.ComputeHash(dataBuffer);  
    return Convert.ToBase64String(hashBytes); 
}
long timestamp = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
string stringToSign = "appId=" + appId + "&timestamp=" + timestamp.ToString();
string signature = HMACSHA1Text(stringToSign, appSecret)
```