Commit Graph

3 Commits

Author SHA1 Message Date
Christopher Haster
9a9b3fc161 scripts: Reverted crc32c.py to naive CRC implementation
The naive implementation is simpler, less code, and more likely to be
correct, each of these are more valuable than speed in our debug
scripts.

We're in Python anyways (no offense Python!).

Plus I think it's good to show that the underlying logic of CRCs aren't
really that complex, at least until we throw optimizations into the mix.
2024-07-31 12:17:13 -05:00
Christopher Haster
9905bd397a Extended crc32c.py to support hex sequences and strings
So now the following forms are supported:

  $ ./scripts/crc32c.py -x 41 42 43 44
  fb9f8872

  $ ./scripts/crc32c.py -s abcd
  fb9f8872

  $ echo '00: 41 42 43 44' | xxd -r | ./scripts/crc32c.py
  fb9f8872

Hopefully this will make crc32c.py more useful. It hasn't seen very much
use, though that may just be because of the difficulty marshalling data
into a format crc32c.py can operate on.

That and dbgblock.py's -x/--cksum flag covering one of the main use
cases.
2024-04-01 16:27:59 -05:00
Christopher Haster
e7bf5ad82f Added scripts/crc32c.py
This seems like a useful script to have.
2023-09-15 18:42:48 -05:00