Ejemplo n.º 1
0
        private static int CalculateWeakSum(byte[] buf)
        {
            Rollsum rollsum = new Rollsum();

            rollsum.Update(buf);
            return(rollsum.Digest);
        }
Ejemplo n.º 2
0
        private static void ReadNewBlock(BinaryReader inputStream, int blockLength, out Queue <byte> newBlock, out Rollsum newRollsum)
        {
            var newBlockBytes = inputStream.ReadBytes(blockLength);

            newBlock   = new Queue <byte>(newBlockBytes);
            newRollsum = new Rollsum();
            newRollsum.Update(newBlockBytes);
        }
Ejemplo n.º 3
0
        private static void ReadNewBlock(BinaryReader inputStream, int blockLength, out Queue <byte> newBlock, out Rollsum newRollsum)
        {
            byte[] array = inputStream.ReadBytes(blockLength);
            int    num   = array.Length;

            newBlock = new Queue <byte>(num);
            for (int i = 0; i < num; i++)
            {
                newBlock.Enqueue(array[i]);
            }
            newRollsum = new Rollsum();
            newRollsum.Update(array);
        }
Ejemplo n.º 4
0
 private static int CalculateWeakSum(byte[] buf)
 {
     Rollsum sum = new Rollsum();
     sum.Update(buf);
     return sum.Digest;
 }
Ejemplo n.º 5
0
 private static void ReadNewBlock(BinaryReader inputStream, int blockLength, out Queue<byte> newBlock, out Rollsum newRollsum)
 {
     var newBlockBytes = inputStream.ReadBytes(blockLength);
     newBlock = new Queue<byte>(newBlockBytes);
     newRollsum = new Rollsum();
     newRollsum.Update(newBlockBytes);
 }