Hi, Gurus. What hashing algorithm outputs hash value as numbers only? For example, if you pass a “John Q. Public” it will output 23324. If there is no such hashing, how hard is it to hire somebody to write a fairly quick one? It could be some fast hashing and then another function that creates numbers. Much obliged. wkatz.

09-10-2006

laserlight

Quote:

What hashing algorithm outputs hash value as numbers only?

If you remove the restriction on "only", I think it would be all of them. Otherwise, it would be none of them, insofar as non-numeric data can be mapped to numbers and vice versa.

Quote:

If there is no such hashing, how hard is it to hire somebody to write a fairly quick one?

Impossible, obviously. If it cannot be done, not even if you offer your soul as the price could it be done.

09-10-2006

wkatz

Thanks, Laserlight!

09-10-2006

Salem

> What hashing algorithm outputs hash value as numbers only?
All of them I would say.

> if you pass a “John Q. Public” it will output 23324.
A very basic one would be just add up the ASCII values of all the letters.
Like 'J' + 'o' + 'h' + 'n' etc etc

A good hash is another matter, one which doesn't produce obvious collisions for all anagrams for example.

09-10-2006

Prelude

>What hashing algorithm outputs hash value as numbers only?
That's the definition of a hash function. It maps keys to integers that can be used as the index for a table. You probably want an algorithm that's tuned for strings, like shift-add-xor: