This one line function adds up the ascii values of a string and returns the total as a checksum. Also included is a variation which returns the checksum mod 256 (so it can be utotal as a checksum. Also included is a variation which returns the checksum mod 256 (so it can be used as a single byte).

The same technique can be used to add up a list of numbers, or to return the average of a list (examples are also included) or to do any other simple processing on a list or a string.


Download from: Homepage




Author:
admin
Time:
Tuesday, June 10th, 2008 at 8:08 am
Category:
Uncategorized
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation:

Leave a Reply