Ideally we wouldn't duplicate the checksum calculation logic found here. If duplication is necessary we should have tests to ensure they're consistent.
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/Message.java#L219
and
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/MessageUtils.java#L277
and sort of
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/FieldMap.java#L562
Weirdly the string-based algorithms work differently
- Message#setChecksum : iterates backwards (an odd choice) and adds 1 (for an SOH it otherwise excludes?)
- MessageUtils#checksum : iterates forwards but doesn't add 1
This would be a minor quibble I wouldn't have come across except that while trying to support multi-byte charsets it behaved weird and it took higher level tests to catch it.
Ideally we wouldn't duplicate the checksum calculation logic found here. If duplication is necessary we should have tests to ensure they're consistent.
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/Message.java#L219
and
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/MessageUtils.java#L277
and sort of
https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/FieldMap.java#L562
Weirdly the string-based algorithms work differently
This would be a minor quibble I wouldn't have come across except that while trying to support multi-byte charsets it behaved weird and it took higher level tests to catch it.