Generate fixed length hash in python for url parameter

Posted by LeRoy on Stack Overflow See other posts from Stack Overflow or by LeRoy
Published on 2010-04-08T05:53:24Z Indexed on 2010/04/08 6:23 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

I am working in python on appengine.

I am trying to create what is equivalent to the "v" value in the youtube url's (http://www.youtube.com/watch?v=XhMN0wlITLk) for retrieving specific entities. The datastore auto generates a key but it is way too long (34 digits). I have experimented with hashlib to build my own, but again I get a long string. I would like to keep it to under 11 digits (I am not dealing with a huge number of entities) and letters and numbers are acceptable.

It seems like there should be a pretty standard solution. I am probably just missing it.

© Stack Overflow or respective owner

Related posts about python

Related posts about hash