> I am not concerned if they can send the hash back. I dont want them to > be able to access the underling value that the hash is based on. > > I am also not concerned about spam, but rather just dont want to expose > raw database ids to the public.
Gotcha, I mis-understood your original question then. So you don't need to encrypt your database IDs, you just need them to be non- sequential. I would use a UUID. Django doesn't have that option built in for use as the pk, so it'd have to be another column, but it's easy enough. There is a uuid module as well which makes generating them quite simple. You can override the save() method in your model to automatically generate the UUID which is what I did. http://zesty.ca/python/uuid.html And usage: ... import uuid def save(self): if not self.id: self.uuid = uuid.uuid1() super(Model, self).save() This makes it pretty painless. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---