📄 mod256.cpp
字号:
// Created:10-31-98
// By Jeff Connelly
// Modulo 256 Checksum Generation
// Based on the (example) algorithm from document
// "A Painless Guide to CRC Error Detection Algorithms"
// by Ross Williams, 1993.
// As the document above explained that this is not a very good checksum
// method. There is a 1/256 chance that an error will not be caught!
#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"
unsigned char EXPORT mod256_checksum()
{
register char c;
register char checksum = 0;
while (!end_of_data())
{
c = read_byte();
checksum += c % 256;
}
return checksum;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -