Re: Unique ID on 5.0.4 (Windows)
| From: | Dragan Stanojevic - Nevidljivi | Date: | Thu, 22 Sep 2005 01:45:17 +0000 |
| Subject: | Re: Unique ID on 5.0.4 (Windows) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-222954@lists.php.net to get a copy of this message | ||
Hi Chris,
Chris wrote:
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Pretty soon I'm going to be needing to generate a unique identifier in a script. I'm looking into how to go about doing it now. It has to work on Apache 2 / PHP 5.0.4 (Module) / Windows 2000 Server. Any suggestions on how I might be able to do it? I'd appreciate any help you could give me.What you need is called hash function (function for creating keys in hash tables). In PHP manual they are categorized under String functions... The way they work is that for any given string they return a (index) number (it can be shown a string of hex numbers) which is unique or almost unique (depending on the algorithm). The ones you may be interested are: md5, sha1, crc32 http://www.php.net/md5 http://www.php.net/sha1 http://www.php.net/crc32 Failing those, you may use mhash functions: http://www.php.net/manual/en/ref.mhash.php Hope this will help you a little, N::
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s