[Mono-list] Using dataconverter.cs to calculate file checksum...?

griffijg john.george.griffiths at gmail.com
Fri Oct 3 17:31:13 EDT 2008


Hi,

I'm trying to convert a perl script to C# and hoping to use the
dataconverter functionality to re-create the code below which calculates a
checksum based on the content of a tar file.  Can anyone show me how this
can be done?   All help appreciated!

John

In Perl this checksum is calculated using the unpack function:
 
while (<PACKAGE>) {
 $checksum += unpack("%32C*", $_);
    }
    $checksum %= 32767;
    close(PACKAGE);
}
 
where PACKAGE is the .tar file input stream


-- 
View this message in context: http://www.nabble.com/Using-dataconverter.cs-to-calculate-file-checksum...--tp19805917p19805917.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list