Added rolling-hash function