ACRCloudWebAPITest.IdentifyProtocolV1.encryptByHMACSHA1 C# (CSharp) Method

encryptByHMACSHA1() public static method

public static encryptByHMACSHA1 ( string input, string key ) : string
input string
key string
return string
        public static string encryptByHMACSHA1(string input, string key)
        {
            HMACSHA1 hmac = new HMACSHA1(System.Text.Encoding.UTF8.GetBytes(key));
               byte[] stringBytes = Encoding.UTF8.GetBytes(input);
               byte[] hashedValue = hmac.ComputeHash(stringBytes);
               return encodeToBase64(hashedValue);
        }