ACRCloudUploadFile.ACRCloudUploadFile.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);
        }