On a REST based system what are the options to "encrypt" resources ID.
For instance:
/client/2
would be accessible at
/client/SOMEHASHKEY
I am thinking :
1 - Have DB tables that keeps track of a resource ID and it's corresponding HASH and look it up on every request. This obviously seems quite heavy to implement, and increase server work quite a bit.
2 - Have some kind of internal encrypting algorithm that would create a hash for instance based on the resources creation date, the resources ID and base64 it (Obviously not optimal but you get the point)
So are there good practices for this kind of scenarios? What would you recommend ?
Many Thanks