Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch. 45 checksum.py - changes output format to columns; fixes the readme #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlalbing
Copy link

in the README file:
fixes an error
-D 2 should have been a -d 2 in an example
changes the examples to use the new output format

in checksum.py
reorders some code so that the data_size parameter is correct when the user uses -D to supply custom data

rearranges some code so that the printout of data values is in columns (rather than rows):
        for easier summing, xor-ing
        for cleaner display for larger values of -d  (avoids line wrapping)

Here is the new order; much easier to do checksums on a column of data.
Decimal: Hex: Bin:
216 0xd8 0b11011000
194 0xc2 0b11000010
107 0x6b 0b01101011
66 0x42 0b01000010

in the README file:
    fixes an error
        -D 2 should have been a -d 2 in an example
    changes the examples to use the new output format

in checksum.py
    reorders some code so that the data_size parameter
    is correct when the user uses -D to supply custom data

    rearranges some code so that the printout of data values
    is in columns (rather than rows):
            for easier summing, xor-ing
            for cleaner display for larger values of -d
@carlalbing
Copy link
Author

If the user specifies data values via -D 1,2,3,4,5,6,7 it seems that the data size should say 7 whereas it currently stays at 4 unless explicitly set via -s 7. This mod also fixes that issue. The big change, having the data in columns, is much handier for showing how the checksums work, as the binary numbers line up in a single column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant