horner modular hash function