Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/tenon/s3_signature.rb

Instance Method Summary collapse

Instance Method Details

#js_shl(count) ⇒ Object

32-bit left shift



212
213
214
215
# File 'lib/tenon/s3_signature.rb', line 212

def js_shl(count)
  v = (self << count) & 0xffffffff
  v > 2**31 ? v - 2**32 : v
end

#js_shr_zf(count) ⇒ Object

32-bit zero-fill right shift (>>>)



218
219
220
# File 'lib/tenon/s3_signature.rb', line 218

def js_shr_zf(count)
  self >> count & (2**(32 - count) - 1)
end