Thanks red_prig for the fast answer. That did the trick.
The runtime error also happens with other hash algorithms like murmurhash3 or xxhash.
Adding {$RANGECHECKS OFF} or {$OVERFLOWCHECKS OFF} solved the errors.
Thaddy solution also works fine and eliminates the runtime errors so you don't need to use the directives but I guess that it adds a little bit of logic to the loop...?
I also found that you can and the result bits with $FFFFFFFF to avoid the runtime errors. But you are adding an extra operation.
Thanks for the useful answers!
