LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any info on CRC, checksum, or other file integity VIs for large binary files?

Working on send rather large binary files (U16 stream to file) via internet. Would like to check for file integity via CRC or comparable checksum. Would appreciate any comments/suggestions
0 Kudos
Message 1 of 5
(4,090 Views)
Hi Brian,

You said;

"Would appreciate any comments/suggestions".

You did not mention what transport mechanism you plan on using.

As I understand ALL of the standard mechanism use CRC of some form to ensure the validity of the packet BEFORE it is ever passed up the OSI 7-Layer model.

TCP/IP based protocols will see to it that all of the segments of a transfer are completed and in order.

UDP on the other hand is a broadcast type protocol and does not ensure any packets are recieved.

So,
At the very worst you should be able to handle your "sanity checks" by simply using a sequence value that is included in your out-going message. The reciever should just have to check if the current seq value is equal to the previous +1.

I co-developed an app that ut
ilized this technique to transfer status messages from a RT platform to a Windows machine. The status messages in this app where concidered FYI, so the sequence counter served as a way of determining if anything was missed.

I am insterested in others thoughts on this subject.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(4,089 Views)
Hi,

We have a commersial set of vi's to comply with 21 CFR part 11. This also
includes digital signatures and hash algorithms.

Regards,

Wiebe.


"brianprogram" wrote in message
news:506500000008000000FD6D0000-1031838699000@exchange.ni.com...
> Working on send rather large binary files (U16 stream to file) via
> internet. Would like to check for file integity via CRC or comparable
> checksum. Would appreciate any comments/suggestions
0 Kudos
Message 3 of 5
(4,088 Views)
I have 2 ideas for you.
1. Read the file data using one of the read file VI's under the File
I/O pallette menu, and then calculate the CRC or checksum yourself. I
have done this for some short files, but it may be impractical for
long files. It also can give errors, if your data has field of all
zeros or all ones (0+0+0=0, but if a line is missing, you may not know
it)

2. Use a hash function. A hash is like a CRC, but longer and more
complicated, it can usually be a number between 32 and 128 bits long,
and is more secure. I use MD5, which generates a 128 bit
"fingerprint" for each file, regardless of its length. You can get
MD5 tools for almost any platform,(win32, perl, unix, mac, java) and
some of them can be run as a script. I use the SystemExec.vi in
Labv
iew to call a MD5 tool as a command line to check files.
Check the following 2 websites for a more detailed description of MD5,
and MD5 utilities.

http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html
http://www.fourmilab.ch/md5/
0 Kudos
Message 4 of 5
(4,088 Views)
I've submitted some MD5 VIs to Developer Zone that should become live soon. Search Developer Exchange for "MD5" for another recent thread on this topic.
0 Kudos
Message 5 of 5
(4,088 Views)