Пример #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();
            }
Пример #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;
        }
Пример #3
0
 public RabinKarpHashEnumerable(string s, int blockSize, IHashCoefficientTable hasher)
 {
     _input     = s;
     _blockSize = blockSize;
     _hasher    = hasher;
 }