On Jul 5, 4:06 pm, jerry <[EMAIL PROTECTED]> wrote:
> However, I wonder how an md5 string can be squeezed into a 10, or even
> 6-character field with no concern of (future) collision -- or am I mis-
> understanding your db schema?

You're misunderstanding the concept.

1. md5(random+time) to get a random string with good dispersion.
2. Then truncate to 6/8/10/however many chars I need
3. check for collision, if found goto 1
4. insert into db ( in unique field )

there's no need to reverse mapping or use the md5 as a checksum.  its
just a way to find random numbers.

the strings are just unique ids, they don't have to map backwards and
forwards.  md5 is just a very efficient way to create a reasonably
unique id, and then you can do a quick check for collision.

in terms of large-scale sites, i believe both bebo and imeem both do
this with 6char ids
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to