From: James Britt Date: 2005-06-08T23:31:46+09:00 Subject: Re: Ruby version ot TEA (Tiny Encryption Alogrithm)? Max Nickel wrote: >>Related question: The JavaScript version uses a shift right, zero fill >>operation. Ruby seems to only offer signed shift-right. Is this the >>case? Is there a Ruby version of shift right, zero fill someplace? > > > AFAIK Ruby only supports arithmetic, not logical right shift. But > logical right shift is quite easy to implement. Just shift the number of > bits and then mask the same number of the "front" bits. > For example, if you have a 32-Bit long number and want to shift one bit > & fill with zero you could do > i = (i >> 1) & 0x7FFFFFFF Ah. Yes. Thanks! James