예제 #1
0
        private StateFunc ReadChunk()
        {
            chunk    = new byte[signature.ChunkSize];
            chunkLen = @new.Read(chunk, 0, chunk.Length);

            if (chunkLen == 0)
            {
                return(Flush); // ???
            }
            rs = new Rollsum();
            rs.Update(chunk, chunkLen);

            return(Search);
        }
예제 #2
0
        int DoGetHash()
        {
            var code = 0;

            if (alg != null)
            {
                code ^= alg.GetHashCode();
            }

            if (sum != null)
            {
                var hash = new Rollsum();
                hash.Update(sum, sum.Length);

                code ^= (int)hash.Digest;
            }

            return(code);
        }