implement some checksum function