github.com/goblimey/go-crc24q

go-crc24q reads a stream of bytes from standard input, appends 3 bytes (24 bits) of CRC and writes the result to standard output. The input data should be 2048 bytes or less. Any more is ignored. The input and output files are binary. Under UNIX, they can be viewed like so: $ od -A x -t x1z -v {file} Running the program against the supplied test input like so: will display: and the file "result" will look like this: This is the data from the input file with a three-byte checksum value (bytes e5, 1e and d8) added to the end. The result is an RTCM message frame, composed of a 24-bit header, a variable-length message and a 24-bit CRC value. The first 8 bits of any RTCM message header is always d3. The lower 10 bits of the header give the message length. The message follows. The first 12 bits of the message give the message type, in this case type 1127 (BeiDou Full Pseudoranges and PhaseRanges plus CNR (high resolution)). The 24-bit checksum follows the message. RTCM messages can be sent over lossy media such as radio links and are thus prone to becoming scrambled in transit. When a message arrives, the receiver should recalculate the CRC value and check that it matches the CRC in the message frame. If so, then it's highly likely that the message has survived intact.


License
MIT
Install
go get github.com/goblimey/go-crc24q