Categories: None [Edit]

permalinkable

https://rubygems.org/gems/permalinkable
https://github.com/yangou/permalinkable
This is a gem originated from another gem called permalink. Since I often want a permalink that provides no way to tell the database ids, I came up with the idea about encrypting the id and prepending it to the permalink. For more information about FPE(Format Preserving Encryption), please consult the wikipedia. The encryption method of current release is simply RC4-40 with a configurable key. Note, RC4-40 is not a strong encryption algorithm at all, and you shouldn't rely on it to delivery sensitive information. Also, to prevent inconsistance of encryption, and duplication(although the chance is very low) you should keep your key as a secret and never change it. The original implementation of generating permalink involves a infite loop to check uniqueness in database. It's slow, inefficient and most importantly, it still can't prevent race condition. And since we are using a FPE algorithm on the database id, which is garanteed to be unique from database, we don't need to put ourselves in that inefficient loop. Finally, what's the purpose of this gem? It's only a gem that helps hiding your database ids.

Total

Ranking: 114,494 of 186,995
Downloads: 5,929

Daily

Ranking: 162,660 of 186,959
Downloads: 0

Depended by

RankDownloadsName

Depends on

RankDownloadsName
27909,782,048rspec
36698,603,704activerecord
101408,027,237hashie
276161,097,927sqlite3

Owners

#GravatarHandle
1iconyang_ou