INNER CODE UNIT · Python

checksum

StratCraftsAI/NexusFix · fuzz/gen_corpus.py:29

    checksum = sum(ord(c) for c in partial) % 256
    return partial + f"10={checksum:03d}{SOH}"


def nos(begin_string, seq):
    # NewOrderSingle (35=D)
    return frame(begin_string, [
        ("35", "D"), ("49", "SENDER"), ("56", "TARGET"), ("34", str(seq)),
        ("52", "20231215-10:30:00"), ("11", "ORDER123"), ("55", "AAPL"),
        ("54", "1"), ("60", "20231215-10:30:00"), ("38", "100"),
        ("40", "2"), ("44", "150.25"),
    ])


def exec_report(begin_string, seq):
    # ExecutionReport (35=8)
    return frame(begin_string, [
        ("35", "8"), ("49", "SENDER"), ("56", "TARGET"), ("34", str(seq)),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…