I am trying to recreate a Perl script in C #, but have a problem creating the checksum value that the target system requires.
In Perl, this checksum is calculated using the unpack function:
while (<PACKAGE>) { $checksum += unpack("%32C*", $_); } $checksum %= 32767; close(PACKAGE);
where PACKAGE is the input stream of the .tar file
I need to replicate this in C #, but cannot find a means to replicate this unpack function.
All help appreciated!
(I know that there are much better checksum calculations, but they cannot change the target system, so you cannot change the calculation)
Chris
source share