We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi all, I would like to implement the following matlab crc check algorithm in Python using crcmod library:
crc8 = comm.CRCGenerator('Polynomial','z^8 + z^2 + z + 1', 'InitialConditions',1,'DirectMethod',true,'FinalXOR',1); codeword = crc8([0; 0; 1; 0; 0; 1; 1; 1; 1; 0; 1; 0; 0; 1; 1; 1]); crc= codeword(end-8+1:end)';
I have implemented it in the following way in python:
crc8_func = crcmod.mkCrcFun(0x107, initCrc=1, rev=False, xorOut=1) crc_received = [0,0,1,0,0,1,1,1,1,0,1,0,0,1,1,1] crc = crc8_func(bytes(crc_received))
The expected result should be:
10010001 (binary) or 145 (decimal) or 91 (hex)
But instead I get:
10101001 in binary. Do you know what I am doing wrong?
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered:
I have found the error, it should be initCRC=0 and xorOut=0xFF.
crc8_func = crcmod.mkCrcFun(0x107, rev=False, initCrc=0, xorOut=0xFF)
Sorry, something went wrong.
No branches or pull requests
Hi all, I would like to implement the following matlab crc check algorithm in Python using crcmod library:
I have implemented it in the following way in python:
The expected result should be:
10010001 (binary) or 145 (decimal) or 91 (hex)
But instead I get:
10101001 in binary. Do you know what I am doing wrong?
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: