Closed bnjmnp closed 3 years ago
Thank you @hex-in for your effort to create and share this Python package, this is great work.
I need to calculate a crc8 variant that is not related to a standard. Therefore I tried to use the
libscrc.hacker8()
function. But it turned out that settingrefin=True
orrefout=True
dose not have any effect on the result.If I do this:
import libscrc crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=False, refout=False) print(hex(crc8)) crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=True, refout=False) print(hex(crc8)) crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=False, refout=True) print(hex(crc8))
crc8 is always 0xc2. But with
refin=True
it should be 0x70 and withrefout=True
it should be 0x43. I checked this with two online crc calculators. [1][2][1] http://www.sunshine2k.de/coding/javascript/crc/crc_js.html [2] http://zorc.breitbandkatze.de/crc.html
Hi, I got your feedback,I will check to solve this problem as soon as possible. Thank you~
Thank you @hex-in for your effort to create and share this Python package, this is great work.
I need to calculate a crc8 variant that is not related to a standard. Therefore I tried to use the
libscrc.hacker8()
function. But it turned out that settingrefin=True
orrefout=True
dose not have any effect on the result.If I do this:
import libscrc crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=False, refout=False) print(hex(crc8)) crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=True, refout=False) print(hex(crc8)) crc8 = libscrc.hacker8(b'1234', poly=0x7, init=0, xorout=0, refin=False, refout=True) print(hex(crc8))
crc8 is always 0xc2. But with
refin=True
it should be 0x70 and withrefout=True
it should be 0x43. I checked this with two online crc calculators. [1][2][1] http://www.sunshine2k.de/coding/javascript/crc/crc_js.html [2] http://zorc.breitbandkatze.de/crc.html
Hi @bnjmnp I have fixed this issues. I will release it in v1.7
1 .Please tell me ur python and os version . I can release a version first and send *.whl package to you.
Finally, thank you very much for your issues.
Best regards.
Please try again (Update latest version v1.7.1).
Please try again (Update latest version v1.7.1).
Very good. Now it is working fine. Thank you!
Thank you @hex-in for your effort to create and share this Python package, this is great work.
I need to calculate a crc8 variant that is not related to a standard. Therefore I tried to use the
libscrc.hacker8()
function. But it turned out that settingrefin=True
orrefout=True
dose not have any effect on the result.If I do this:
crc8 is always 0xc2. But with
refin=True
it should be 0x70 and withrefout=True
it should be 0x43. I checked this with two online crc calculators. [1][2][1] http://www.sunshine2k.de/coding/javascript/crc/crc_js.html [2] http://zorc.breitbandkatze.de/crc.html