Esempio n. 1
0
            public RabinKarpHashEnumerator(string s, int blockSize, IHashCoefficientTable hasher)
            {
                _input     = s;
                _blockSize = blockSize;
                _hasher    = hasher;

                if (s.Length < _blockSize)
                {
                    throw new ArgumentException("Block size cannot be smaller than input string length.", "blockSize");
                }

                Reset();
            }
Esempio n. 2
0
        public RabinKarpHash(int blockSize, IHashCoefficientTable hasher)
        {
            int b2n = 1;

            _n      = blockSize;
            _hasher = hasher;

            for (int i = 0; i < _n; i++)
            {
                b2n *= _b;
            }

            _b2n = b2n;
        }
Esempio n. 3
0
 public RabinKarpHashEnumerable(string s, int blockSize, IHashCoefficientTable hasher)
 {
     _input     = s;
     _blockSize = blockSize;
     _hasher    = hasher;
 }