Author cmcqueen1975
Recipients cmcqueen1975, dtorp, josiahcarlson, mark.dickinson, tim.peters
Date 2010-01-27.00:50:08
SpamBayes Score 4.77654e-09
Marked as misclassified No
Message-id <1264553409.74.0.263939612934.issue1205239@psf.upfronthosting.co.za>
In-reply-to
Content
To complete that thought...

Since crc << 8 could bump the calculation into long territory, for that final mask I guess I'd want to mask and then shift. I.e. rather than

    crc_mask = ((1 << crc_width) - 1)
    crc = (...) ^ ((crc << 8) & crc_mask)

do:

    crc_lower_mask = ((1 << (crc_width - 8)) - 1)
    crc = (...) ^ ((crc & crc_lower_mask) << 8)

But that expression should evaluate to 0 if crc_width <= 8, so I guess I'll need to special-case it. And if I special-case it, I don't need to shift by a negative value after all!
History
Date User Action Args
2010-01-27 00:50:09cmcqueen1975setrecipients: + cmcqueen1975, tim.peters, josiahcarlson, mark.dickinson, dtorp
2010-01-27 00:50:09cmcqueen1975setmessageid: <1264553409.74.0.263939612934.issue1205239@psf.upfronthosting.co.za>
2010-01-27 00:50:08cmcqueen1975linkissue1205239 messages
2010-01-27 00:50:08cmcqueen1975create