title: Adapting Skip32 to a 31-bit block Cipher
body: <p>So here's a ruby implementation of Skip32 by patdeegan:</p>
  
  <p><a href="https://github.com/patdeegan/integer-obfuscator/blob/master/lib%2Fcipher%2Fskip32.rb" rel="nofollow">https://github.com/patdeegan/integer-obfuscator/blob/master/lib%2Fcipher%2Fskip32.rb</a></p>
  
  <p>I'm currently using this patdeegan/integer-obfuscator to create a non sequential id corresponding to each of my db ids. The thing is, I need this ID to be between 0 and ((2^31)-1) and the above generates ids that go up to ((2^32)-1)</p>
  
  <p>I have little understanding of bitwise operations but <a href="http://undeadly.org/cgi?action=article&amp;sid=20080804095748" rel="nofollow">this article</a> seems to state they tweaked Skip32 to generate an integer on only 31-bit.</p>
  
  <p>Does someone know how this would need to be adapted and explain it to me ?</p>