I’m working on building a REST API on Rails. One thing I don’t want to expose my auto increment id of resource on public API because I don’t want them to guess or know the number of resources that created on my system, and another reason which is a new app as well, so the id starts 1, 2, 3.
http://api.example.com/v1/users/1 -> http://api.example.com/v1/users/1254125412
I’m not sure, is there any algorithm to turn “1” into unique random integer? I could go with UUID, but I prefer to use integer which is smaller indexes and faster as well.