da4089 / simplefix

Simple FIX protocol implementation for Python
MIT License
233 stars 64 forks source link

Checksum is not always 3 ASCII characters #58

Closed hptabster closed 1 year ago

hptabster commented 1 year ago

The FIX protocol specifies that the checjsum should be 3 ASCII characters. I am observing that simplefix (1.0.16) sometimes sends less, i.e., 2 characters: 2023-09-11 13:16:44,485 : process_buffer : INFO : Sending FIX heartbeat message 8=FIX.4.4|9=67|35=0|49=QAORG1_UAT|56=STP_ROUTER_UAT|34=2|52=20230911-17:16:44.485|10=88

hptabster commented 1 year ago

Update this code to a formatted f-string that is always 3 digits: f"{checksum % 256:0>3}"

da4089 commented 1 year ago

Thanks for the report. Fixed in v1.0.17, now on PyPI.