Re: Create a numeric hash from a text string?
| From: | Richard Lynch | Date: | Mon, 14 Nov 2005 20:08:08 +0000 |
| Subject: | Re: Create a numeric hash from a text string? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225770@lists.php.net to get a copy of this message | ||
On Mon, November 14, 2005 12:41 pm, Brian Dunning wrote:
> Does anyone know if there's a handy way to create a numeric hash from
> a text string? I'm trying to generate an integer as a sort of quick &
> dirty checksum for text strings. Needs to be a decimal integer, not
> hex or otherwise. Any clever ideas appreciated. :)
Why an integer?...
For that matter, down in the guts, it's all just an integer,
technically...
Do you need a 32-bit integer for some reason?
Something involving md5, substr, and http://php.net/pack should
sort
of work.
You're probably better off re-thinking your "needs to be an integer"
requirement, though, honestly, unless there is some really really
compelling driving external force at work.
--
Like Music?
http://l-i-e.com/artists.htm