tpircher-zz / pycrc

Free, easy to use Cyclic Redundancy Check (CRC) calculator and source code generator
https://pycrc.org
MIT License
169 stars 36 forks source link

Binary files with Python 2.7 #11

Closed jamesbowman closed 8 years ago

jamesbowman commented 9 years ago

My binary file starts with 0xff - and when I run:

$ python2.7 ~/git/pycrc/pycrc.py --model=crc-16 --check-file forthboot.bin --xor-in=0xffff --reflect-out=0 --xor-out=0xffff
Traceback (most recent call last):
  File "/Users/jamesb/git/pycrc/pycrc.py", line 269, in <module>
    sys.exit(main())
  File "/Users/jamesb/git/pycrc/pycrc.py", line 240, in main
    crc = check_file(opt)
  File "/Users/jamesb/git/pycrc/pycrc.py", line 198, in check_file
    register = crc_file_update(alg, register, check_bytes)
  File "/Users/jamesb/git/pycrc/pycrc.py", line 152, in crc_file_update
    check_bytes = bytearray(check_bytes, 'utf-8')

Works fine with python3.5