title: Efficient rolling hash function
body: <p>Based on : <a href="https://stackoverflow.com/a/20412573/4058644">https://stackoverflow.com/a/20412573/4058644</a> <br>
  I implemented the below:<br></p>
  
  <pre><code>for (...)
  {
      unsigned long long RollingHash = 0;
      int k = LineSize - 1;
  
      for (size_t j = 0; j &lt; LineSize; ++j)
      {
          if (condition)
          {
              RollingHash += (Line[j] * pow(257, k)) % MOD;
              RollingHash %= MOD;
              k -= 1;
          }
      }
  }
  </code></pre>
  
  <p>However, I have 2 issues:<br></p>
  
  <ol>
  <li>It does not seem to be much efficient/fast</li>
  <li><p>Adding/Removing values to start or end as per the link does not seem to work</p>
  
  <pre><code>unsigned long long  h = (Line[0] * pow(257, Line.size()))%MOD;
  old = ((old * 257) + 'h' - h) % MOD;
  </code></pre></li>
  </ol>
  
  <p>Any ideas?</p>