Checksum Guide - rsanchez-wsu/jfiles GitHub Wiki
Background
A checksum is a digit representing the sum of the correct digits in a piece of stored or transmitted digital data, against which later comparisons can be made to detect errors in the data. The reason that this is implemented into our code is that we are sending files back and forth from a server to a client. To verify that nothing was lost in the transition between the server and client or from client to server the program runs a checksum on the data transmitted.
Implementation
- The function will create find the file that needs to be transmitted and break it into a stream of bytes that will be read by the checksum algorithm and create the file.
- The function will send that stream of bytes along with the value computed by the checksum
- The function will create a file with the stream of bytes.
- The function will read that file back into bytes and take that stream and run a checksum on it.
- The function will compare the 2 values and throw an error message if they are not the same.
- This function will be implemented in its own class and be referenced by both Client and Server.
Version 11/6/2016
- Function is in Beta currently fully implemented need extensive testing to confirm.