So tbHashin is a textbox on your form and you're just passing the text through? What kind of things are you testing with?
Can you try copy/pasting the code I wrote (into a new Console Application) and seeing if that works? I did try some longer strings, but nothing over 200 characters.
Looking at the code, that you get an overflow exception isn't that surprising because you keep multiplying by 16777619, but I looked at it and the bits just overflow and reset to a lower number. There is a way to force overflow checking though... and it's also a project setting. The first thing to check is your project's properties... click the
Build tab, scroll down and click the
Advanced button. Uncheck
Check for arithmetic overflow/underflow if it is checked.
Alternatively, if you want to leave that setting enabled, you can specifically check or not check commands by putting them in checked or unchecked blocks. So for your function there, put the whole thing in something like this...
- unchecked
-
{
-
// Your code here
-
}