Answer the question
In order to leave comments, you need to log in
What is the function algorithm to translate a string into a unique number?
Hello.
It is necessary to make a function, the input of which is given a string, and the output is a number that is always the same for this particular string. The number must be between 0 and PHP_INT_MAX.
The results should be evenly distributed. For example, if you supply string representations of numbers from 0 to PHP_INT_MAX as input, so that the results of the function ideally repeat as few times as possible.
For example:
f('1') // 6484845
f('11') // 2156165
f('111') // 59544206
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question