Reply to Re: The most efficient encryption method?

Your name:

Reply:


Posted by Alvaro G. Vicario on 08/11/06 20:53

*** howachen@gmail.com escribió/wrote (11 Aug 2006 01:59:53 -0700):
> Nowadays, many site use encrypted resource ID, rather than plain
> numeric ID, such as the following:
>
>>> http://www.youtube.com/watch?v=p_YMigZmUuk

This is not encryption, it's just a random ID (or maybe a hash). The more
different chars you use, the shorter the string can be.

> "p_YMigZmUuk" will be mapped into a database unique ID (numeric, auto
> increment).

I'd just store it as string and unique key.

> What kind of encryption in PHP is the best in handling this job?

You can calculate hashes with md5(), crc32() or sha1(), but you must be
aware that hashes are one-way: you can't get the original string back.

For random strings, you can use uniqid() or you can write a custom function
using mt_rand().


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

[Back to original 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

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