v2.0.0
fully backwards compatible with deprecation warnings
replaces the old syntax with more crystal like syntax:
# OLD
class VerifyData < BinData
endian big
uint8 :size, default: 10_u8
bytes :bytes, length: ->{ size }
uint8 :checksum, verify: ->{ checksum == bytes.reduce(0) { |acc, i| acc + i } }
end
# NEW
class VerifyData < BinData
endian big
field size : UInt8 = 10_u8
field bytes : Bytes, length: ->{ size }
field checksum : UInt8, verify: ->{ checksum == bytes.reduce(0) { |acc, i| acc + i } }
end