I want to create a simple hash function that can hash strings. Currently I'm
storing passwords as strings in a DB but want to store them as a hash. I
don't need any proper standardised hashing e.g. MD4 or MD5. I also want to
be able to write the function completely using VB Script (therefore no
components etc)
I'm thinking along the lines of converting the string into a number
(probably using the ascii values in some simple formula)
Then divide this by a really large prime number (as large as can fit in a VB
Script variable)
And use the remainder as the hash
This is probably very crude but sufficient for my website. Can anyone give
me any tips on the easiest way to do the above or if it can be improved with
very little extra effort.
Also, what is the largest number that can be stored in a VB script variable,
is it a signed 32 bit number?
And the last question is, how can I find out what the largest prime number
is less than that number? Obviously, I don't need to use a prime number but
it would be better if I did. Thanks in advance