Possible Duplicate:
YouTube URL algorithm?
I know one method it can be done... surprisingly, a friend I know who is quite smart doesn't know how to do it... I wonder if this may be a good interview question too.
Interested in other answers. I will post my answer later on.
Update: my answer doesn't use a hash at all...