src/lib/types.rb
# https://developers.google.com/protocol-buffers/docs/encoding
# Easy to just convert to signed and re-use uint code
developers.google.com/protocol-buffers/docs/encoding
Easy to just convert to signed and re-use uint code
developers . google . com / protocol - buffers / docs / encoding Easy to just convert to signed and re - use uint code
def decode(msg)
      value, rest = Uint.new.decode(msg)
      value = value.odd? ? (value + 1) / -2 : value / 2
      return value, rest
    end
def decode ( msg ) value , rest = Uint . new . decode ( msg ) value = value . odd? ? ( value + 1 ) / - 2 : value / 2 return value , rest end
https://developers.google.com/protocol-buffers/docs/encoding
Easy to just convert to signed and re-use uint code
https : // developers . google . com / protocol - buffers / docs / encoding Easy to just convert to signed and re - use uint code
msg
<not_specific>