Crabwise.PdfServe.DocumentCache.ComputeHash C# (CSharp) Method

ComputeHash() private static method

private static ComputeHash ( string templateName, object>.IDictionary templateData ) : byte[]
templateName string
templateData object>.IDictionary
return byte[]
        private static byte[] ComputeHash(string templateName, IDictionary<string, object> templateData)
        {
            string identifier = templateName;
            foreach (var keyValue in templateData)
            {
                identifier += keyValue.Key + keyValue.Value;
            }

            byte[] hash;
            using (var sha512 = new SHA512Managed())
            {
                hash = sha512.ComputeHash(Encoding.Unicode.GetBytes(identifier));
            }

            return hash;
        }