LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating a file's checksum

Hi,

 

Can anyone help me with calculating a file's checksum ?

 

I've attached a file (you need to rename the extention to .py), of which the checksum is 1CFC

I needto create a VI to which I input a path to this file, and then provides me with the checksum value.

 

Thanks

Goose

0 Kudos
Message 1 of 6
(5,031 Views)

The OpenG toolkit has a function called MD5 digest.

A checksum is normally MD5 and this is a 32 byte checksum so much longer than 1CFC.

 

What checksum type do you need.

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 6
(5,008 Views)

Hi,

 

I dont get the same answer as you.

 

To calculate the checksum I

 

1. Read the file as text. EOL is not converted

2. Convert string to U8 array

3. Convert to U16 array

4. Sum all the array elements

 

My answer is 0x8BA7 which is different from yours. How did you arive at the figure in your original post?

 

David

Message Edited by David Crawford on 10-23-2009 01:17 PM
0 Kudos
Message 3 of 6
(5,004 Views)

Thanks.

It is a CRC16 format checksum.

0 Kudos
Message 4 of 6
(4,994 Views)

There are some examples of CRC16 VIs found by searching on this website

 

http://search.ni.com/nisearch/app/main/p/y/0/q/CRC16/x/0/

 

Do any of these work for you?

 

David

Message 5 of 6
(4,981 Views)

Adding to David's suggestion of trying the previously posted examples...

 

Checksum is a generic term. I have run into many different CRC's over the years and in a recent project had to implement two type of checksums in the same message format (the engineers really didn't trust serial!).

 

If none of the posted examples does it, you will either have to get the definition for the CRC you will use... or get creative with reverse engineering the recipe.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(4,975 Views)