Let's say I have a string like this:
whateverthisis123 #_-
I want to convert this string into a number within a number interval forexample within 1-1000.
The above string could for example be converted into
387
This comes with a few rules:
- The string could contain every character.
- The number should feel random but cannot be. The same string should always return the same number.
- Longer string should not make the number higher. Should feel random.
- aaa should not give a number like 222. Should feel random.
- It should accept the interval for example 1 up to 1000.
- "thisstring" and "thisstring1" are alike. The numbers should still not be alike.
Is there a built in function for this in PHP? If not, any clever idea how to create something like this?
Maybe it's easier if first converting in to MD5? http://www.php.net/manual/en/function.md5.php