JSchaenzle/cauterize — pull request #1 by kenfox (2014-03-22 15:14:49+00:00)
Title: add optional checksums to composites

I didn't see any round trip pack/unpack tests, so there are only tests to make sure the code for checksums is generated properly. I developed the checksum code in eko with round trip tests--I just don't know where you'd like to put those tests here. Only the C builder is implemented.

The checksum is RFC 1701 style since that is very fast in software. You could drop in CRC or some other algorithm easily. Both the checksum and length are verified before starting an unpack so if the checksum is strong it will protect (and short circuit) trying to unpack corrupt data.

The eko cauterized characteristics would look something like this with this patch:

```ruby
composite(:bt_msg) do |t|
t.field :seq_num, :uint8_t
t.field :alert, :alert_data
t.checksum
end
```

and

```ruby
composite(:bt_cmd) do |t|
t.field :seq_num, :uint8_t
t.field :dest, :bt_msg_dest
t.field :cmd, :cmd_data
t.checksum
end
```