Method: VariableByteCode.decode_index
- Defined in:
-
lib/ls4/lib/vbcode.rb,
lib/ls4/lib/vbcode.rb
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/ls4/lib/vbcode.rb', line 96 def self.decode_index(raw, from=0) i = from value = 0 while raw.length > i v = raw[i].unpack('C')[0] if v & 0b10000000 != 0 v &= 0b01111111 v <<= ((i-from)*7) value |= v else v <<= ((i-from)*7) value |= v return value, i+1 end i += 1 end return value, i end |