# Any way to hide / mask / salt record ID?

**URL:** <https://www.ruby-forum.com/t/any-way-to-hide-mask-salt-record-id/168471>\
**Category:** Rails\
**Created:** [May 21, 2009, 5:18am UTC](https://www.ruby-forum.com/t/any-way-to-hide-mask-salt-record-id/168471 "2009-05-21T05:18:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjsquire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@rjsquire](https://www.ruby-forum.com/u/rjsquire)\
**Post date:** [May 21, 2009, 5:18am UTC](https://www.ruby-forum.com/t/any-way-to-hide-mask-salt-record-id/168471/1 "2009-05-21T05:18:50Z")

</div>

In RoR applications, each record is accessed by its own ID, usually as  
in products/ID. However, I’d prefer that users not be able to know how  
many records are in the database nor be able to access them on an  
incremental basis. Is there any way to hide or mask this ID through the  
use of an alternate? Salting the IDs seems like it could work, but I’m  
not sure how to do it - if its even the right way.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rjsquire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@rjsquire](https://www.ruby-forum.com/u/rjsquire)\
**Post date:** [May 21, 2009, 8:27am UTC](https://www.ruby-forum.com/t/any-way-to-hide-mask-salt-record-id/168471/2 "2009-05-21T08:27:55Z")

</div>

Robert S. wrote:

> In RoR applications, each record is accessed by its own ID, usually as  
> in products/ID. However, I’d prefer that users not be able to know how  
> many records are in the database nor be able to access them on an  
> incremental basis. Is there any way to hide or mask this ID through the  
> use of an alternate? Salting the IDs seems like it could work, but I’m  
> not sure how to do it - if its even the right way.
> 
> Thanks in advance!

see a plugin [GitHub - hashtrain/acts\_as\_random\_id: Rails plugin for generating random id](http://github.com/hashtrain/acts_as_random_id/tree/master)
