> I would say: avoid using MD5 as a random string generator because it
> hasn't been created for that purpose.
If you want universally unique IDs and you have Python 2.5, see
http://docs.python.org/lib/module-uuid.html.
For my situation, normal autoincremented IDs are fine.
Happy Hacking!
-jj
It doesn't look very safe to me.
if you don't want to expose your id and create fake ids.
random.seed(id + SALT)
string_id ="%x" % random.randint(0, 0x)
and now you have an 8 chars id, with very few risks of collison. Thank
to Mersenne Twister a pretty good pseudo-random number generat
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
Thanks Jonthan.
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?
Sincerely,
Jerry
On Jul 5, 1:57 pm, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
> On Jul 4, 8:58 pm, jerry
On Jul 4, 8:58 pm, jerry <[EMAIL PROTECTED]> wrote:
> But how? What encryption/hashing method could be used to transform the
> numeric IDs to something less obvious?
all my apps have somthing like this in the db:
table hexkey_types
id , len , name
---
1, 10, useraccount:hex_id
2, 6, group:hex_i
But how? What encryption/hashing method could be used to transform the
numeric IDs to something less obvious?
Sincerely,
Jerry
On Jul 4, 2:01 pm, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
> just some points on 'hiding' ids-
>
> - if you're doing a social media site, with numeric ids your
> com
just some points on 'hiding' ids-
- if you're doing a social media site, with numeric ids your
competitors and the annoying industry blogs will be judging and
guaging your popularity and success by sequence ids
- by using the ids, you're good on a pylons app... but lets say you
need to offload s
On Thu, Jul 3, 2008 at 7:37 PM, Krishgy <[EMAIL PROTECTED]> wrote:
> Currently we expose the database tables primary key value in the URL.
>
> For example, to display the User profile, I use
> www.example.com/profile/view/12345
> where profile is my controller and view controller function and 12
i'll often let people see the ids of objects they manage , but when it
comes to public facing info i use hexids that are unique across the
app.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
T
Hi All,
Currently we expose the database tables primary key value in the URL.
For example, to display the User profile, I use
www.example.com/profile/view/12345
where profile is my controller and view controller function and 12345
is actually user id (table: profile, column: uid).
Is this reco
10 matches
Mail list logo