Replace the CRC16-CCITT implementation with one generated by pycrc to be MIT compliant.

This commit is contained in:
Admiral H. Curtiss
2016-10-30 02:49:27 +02:00
parent db6d6b64b6
commit f4aee57e89
6 changed files with 193 additions and 62 deletions

View File

@@ -115,7 +115,8 @@ namespace MysteryGiftConvert {
byte[] outfile = new byte[outStream.Length];
outStream.Read( outfile, 0, outfile.Length );
outStream.Position = outStream.Length;
outStream.Write( Crc16Ccitt.StandardAlgorithm.ComputeChecksumBytes( outfile ), 0, 2 );
ushort checksum = Checksums.Ccitt.Update( Checksums.Ccitt.Init(), outfile, outfile.LongLength );
outStream.Write( BitConverter.GetBytes( checksum ), 0, 2 );
}
} else {
Console.WriteLine( "Input is not a Generation 4 or 5 mystery gift file!" );