[issue1205239] Let shift operators take any integer value

Mark Dickinson report at bugs.python.org
Tue Jan 26 11:57:00 CET 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Interesting.  I agree that that looks like a case where it would be desirable for a >> -n to do a << n.

By the way, I don't think your formula is quite correct:  your crc is going to grow unboundedly as extra data bytes come in.  I suspect that you want to mask the result with (1 << crc_width) - 1 after each update.
(And what's the '& 0xFF' for?  Isn't it redundant?)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1205239>
_______________________________________


More information about the Python-bugs-list mailing list