You are here: Re: [PHP] Unique ID on 5.0.4 (Windows) « PHP « IT news, forums, messages
Re: [PHP] Unique ID on 5.0.4 (Windows)

Posted by Chris on 10/14/43 11:27

Dragan Stanojevic - Nevidljivi wrote:

> 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::

I think you may have misunderstood me, sorry. I need to generate a
unique string, to use as an identifier, in a script, not something to
identify the script itself. A hash won't work for that.

Thanks anyway though.
Chris

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация