INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Checksum of FIX message

Checksum of FIX message

(OP)
Hi,

Has anyone got sample RPG code that works out the checksum of a string?

What code should do:
- take the FIX message stream (string)

- loop through each byte (character):
1) determine the integer value of that byte (e.g. 'A'=65, 'a'=97, '.'=46, note will be <= 256)
2) accumulate (continue to add values to a variable) the integer value of that byte to a variable in order to obtain the sum of the integer value of each byte in the FIX message stream

- compute the modulus (integer of the remainder following division also known as "mod" (C/C++ and Java use "%" for this)) of the sum obtained above when divided by 256

- take the modulus integer value (will always be less than 256 since it was mod'd by 256) and represent it as a 3 character sting with leading zeros if necessary

- use the above 3 character string as the value for Checksum (tag 10)

WP

http://www.neptune400.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close