Re: Unique ID on 5.0.4 (Windows)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

Chris wrote:
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: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux