Answer the question
In order to leave comments, you need to log in
How to get the numeric hash of a string in a given range?
Hello!
We need an algorithm to get the hash of a string.
The hash must be an integer between 0 and n. Where n is set manually.
For example, n = 5.
myhash('test1') = 1
myhash("qwerty") = 5
myhash('hello, world!') = 5
myhash("132") = 0
Thanks.
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