The checksum routine is already present in the zxing library.
If the checksum fails, the zxing library will not return a positive
result or suggest that the checksum is wrong.
But take a look at this site for a detailed explanation how the
checksum is being calculated :
http://www.adams1.com/128code.html
This should be enough information to write the routine.
If not, let us know.