10-23-2009 05:42 AM
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
10-23-2009 07:05 AM
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
10-23-2009 07:16 AM - edited 10-23-2009 07:17 AM
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
10-23-2009 07:44 AM
Thanks.
It is a CRC16 format checksum.
10-23-2009 08:02 AM
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
10-23-2009 08:15 AM
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