I need to design a way to provide a hash for every document stored in my application.
Using existing hash libraries (BCrypt
, etc) and even BSON ObjectId
generates nice "hash" or "key" but its quite long.
I also understand that the only way to achieve short hash, is to hash fewer strings (if not mistaken). Like hash Long
id's staring from 0, 1, 2, 3
and so on.
However it is easy to think of, its fairly hard to implement in the Google App Engine (GAE) Datastore, or I haven't really crossed this need until now.
The GAE Datastore store entities across severs and even across datacenters and auto-increment ID is not really for this.
What could be the strategy to achieve this?