module LXP::Utils
Public Instance Methods
int(bytes)
click to toggle source
# File lib/lxp/utils.rb, line 7 def int(bytes) bytes.each_with_index.map do |b, idx| b << (idx * 8) end.inject(:|) end
int_complement(bytes)
click to toggle source
# File lib/lxp/utils.rb, line 13 def int_complement(bytes) r = int(bytes) r -= 0x10000 if r & 0x8000 == 0x8000 r end