Ejemplo n.º 1
0
        public override byte[] Calculate(params byte[][] arrays)
        {
            byte[] combinedArray = ArrayOps.Combine(arrays);

            using (THashAlgorithm hashAlgorithm = CreateHashAlgorithm())
            {
                byte[] bytes = hashAlgorithm.ComputeHash(combinedArray);
                return(bytes);
            }
        }
Ejemplo n.º 2
0
        public virtual byte[] Serialize <TListType>(TListType list)
            where TListType : IList, IEnumerable <T>
        {
            byte[] returnArray = new byte[0];
            if ((list != null))
            {
                using (IEnumerator <T> itList = list.GetEnumerator())
                {
                    while (itList.MoveNext())
                    {
                        byte[] currentValueArray = Serialize(itList.Current);
                        returnArray = ArrayOps.Combine(returnArray, currentValueArray);
                    }
                }
            }

            return(returnArray);
        }