C++ implementation of cyclic redundancy check method CRC