Sha256: 5436c2b6f47af0c2fbfc25ebdfec96930816f804ba9eff7aa9046b7f8661396e
Contents?: true
Size: 428 Bytes
Versions: 130
Compression:
Stored size: 428 Bytes
Contents
require 'protobuf/field/varint_field' module Protobuf module Field class IntegerField < VarintField def encode(value) # original Google's library uses 64bits integer for negative value VarintField.encode(value & 0xffff_ffff_ffff_ffff) end def decode(value) value -= 0x1_0000_0000_0000_0000 if (value & 0x8000_0000_0000_0000).nonzero? value end end end end
Version data entries
130 entries across 130 versions & 1 rubygems