Exemple #1
0
        string CalculateHash(List <string> contractIds)
        {
            int hashCode = HashCodeUtility.GetPersistentHashCode(contractIds);

            byte[] b    = BitConverter.GetBytes(hashCode);
            string hash = Convert.ToBase64String(b);

            hash = hash.TrimEnd(padding).Replace("+", string.Empty).Replace("/", string.Empty).ToLower();

            return(hash);
        }
Exemple #2
0
        public static int GetPersistentHashCode(List <string> list)
        {
            list.Sort();

            int hashCode = 2;

            foreach (var item in list)
            {
                var itemHash = HashCodeUtility.GetPersistentHashCode(item);
                hashCode = HashCodeUtility.CombineHashCodes(hashCode, itemHash);
            }

            return(hashCode);
        }