Method: Rex::Text.ror
- Defined in:
- lib/rex/text/binary_manipulation.rb
.ror(val, cnt) ⇒ Object
Rotate a 32-bit value to the right by cnt bits
76 77 78 79 80 81 82 |
# File 'lib/rex/text/binary_manipulation.rb', line 76 def self.ror(val, cnt) bits = [val].pack("N").unpack("B32")[0].split(//) 1.upto(cnt) do |c| bits.unshift( bits.pop ) end [bits.join].pack("B32").unpack("N")[0] end |