crc32 (Follows IEEE Standard of Ethernet in Section 3.2.9 )
I used the built in Matlab CRC Generator "comm.CRCGenerator" because it references the IEEE Standard of Ethernet in Section 3.2.9 page 57 from "https://ecfsapi.fcc.gov/file/1050839507018/IEEE%20Standard%20for%20Ethernet.pdf"
comm.CRCGenerator follows steps a-e of Section 3.2.9 - Frame Check Sequence (FCS) Field.
Under the original "crcGen = comm.CRCGenerator" I had to change some true and false and add a few lines of code to make it return the correct CRC. I added lines (1) and (2) and set their values to true. (NOTE: from comm.CRCGenerator Document, the original CRC32 will show 2 examples for computing 2 different ways on how to compute the same CRC. A "Direct" way and "NonDirect" way)
comm.CRCGenerator
'Polynomial', poly, ...
'InitialConditions', 0, ...
'ReflectInputBytes', true, ... % This (1) line was added and set to 'true'
'ReflectChecksums', true, ... % This (1) line was added and set to 'true'
'DirectMethod', false, ...
'FinalXOR', 1);
How to input:
Input 8 bit HEX string the command window by
>> crc32('12345678')
Or you can create a new scrip to call this function
To check: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html
*** Make sure you change the input would be byte and enter as '12345678'
Cite As
WARRIOR24 (2024). crc32 (Follows IEEE Standard of Ethernet in Section 3.2.9 ) (https://www.mathworks.com/matlabcentral/fileexchange/84667-crc32-follows-ieee-standard-of-ethernet-in-section-3-2-9), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |