How to convert a String to a unique INTEGER in php -


how can convert string(i.e. email address) unique integers, use them id.

the amount of information php integer may store limited. amount of information can store in string not (at least if string isn't unreasonably long.)

thus need compress arbitrary-length string non-arbitrary-length integer. impossible without data loss.

you may use hashing algorithm, hashing algorithms may have collisions. if want hash string integer collision probability pretty high - integers can store little data.

thus shall either stick email or use auto incrementing integer field.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -