-
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP...
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP和TCP 等等。计算这些校验和的算法称为网际校验和算法,简单来说就是:把被校验的数据16位进行累加,然后取反码,若数据字节长度为奇数,则数据尾部补一个字节的0以凑成偶数。
由于从输入文件读入的数据不能直接满足计算校验和的条件,所以首先对从文件读入缓冲区的数据进行预处理,即读入缓冲区时忽略空格。由于累加是按16位进行的,所以每次从缓冲区中读出4个字符,并将字符转换成对应的16进制数字,如此依次累加,直至数据全部读完。
还有一种情况,即如果数据长度为奇数个字节,则需要判断,并补0累加。程序中利用的是缓冲区长度计数器i和当前读取到计数器j判断数据长度是否为奇数。即如果数据长度为偶数,则读完数据时当前读取到计数器j的值应与缓冲区长度i相等,而如果数据长度为奇数,则读完数据时,当前读取到计数器j>缓冲区长度i,此时需将缓冲区中剩余的两个字符读出,并补0,转换成相应16进制数以后参与累加。
当累加结束后,将累加和的16位以上数据位移下再进行一次累加,并对最后累加和取反即得所求校验和。
-calculated checksum checksum algorithm Description : To ensure the network transmission of data reliability, in many of the agreements are set up and calibration, for example : IPv4, ICMPv4, IGMPV4, ICMPv6. UDP and TCP so on. Calculating checksum algorithm called the Internet checksum algorithm, the simple answer is : as has been the calibration data for 16 cumulative, and then take the anti-code, if the data byte length of the odd, data will make up the tai
- 2022-01-26 06:39:03下载
- 积分:1
-
我有一个最受推崇的聊天程序,提供的附加功能可以…
本人所最为推崇的一个vc聊天程序 提供添加删除好友功能 可以近乎实时的实现文字聊天功能 强烈推荐 本程序为客户端程序 在用户下载过起服务器程序后即可运行-I have one of the most respected vc chat program to provide added functions can be deleted friend of achieving near real-time text chat feature strongly recommend the procedure for clients to download the user with the server can run after
- 2022-03-25 14:34:02下载
- 积分:1
-
测试网络的带宽代码,输入命令,可以根据命令来进行客户端与服务器间的吞吐量测试!...
测试网络的带宽代码,输入命令,可以根据命令来进行客户端与服务器间的吞吐量测试!-Test network bandwidth code, enter the command, can be carried out under the command between the client and server throughput test!
- 2023-05-27 07:55:04下载
- 积分:1
-
一个不用IE内核的浏览器程序,IE的一般的简单的功能都能实现。...
一个不用IE内核的浏览器程序,IE的一般的简单的功能都能实现。-do not have a core of the IE browser procedures, the general IE simple function can be materialized.
- 2022-08-14 08:51:47下载
- 积分:1
-
MyDownloader is an open source application written in C# that is almost a comple...
MyDownloader is an open source application written in C# that is almost a complete download manager.
- 2022-08-14 14:39:05下载
- 积分:1
-
C:Documents and Settingsyyy桌面新建文件夹 socket.rar
C:Documents and Settingsyyy桌面新建文件夹 socket.rar -C:Documents and Settingsyyy桌面新建文件夹 socket.rarC:Documents and Settingsyyy桌面新建文件夹 socket.rar
- 2022-07-15 12:25:42下载
- 积分:1
-
本程序没有对包的内容解码,仅仅打印出包的二进制内容; *提供最简单的捕获过滤器,即可以指定捕获感兴趣的源IP和目的IP。...
本程序没有对包的内容解码,仅仅打印出包的二进制内容; *提供最简单的捕获过滤器,即可以指定捕获感兴趣的源IP和目的IP。-the right procedures were not decode the contents of packages, just print out the packets of binary content;* Provide the most simple capture filters, which can capture interest in the designated IP source and destination IP.
- 2022-03-21 11:02:58下载
- 积分:1
-
可用于局域网文件传输,多
能够用于在局域网传输文件,采用多线程的方法,基于mfc的对话框类,比较实用-can be used in LAN file transfer, multi-threaded approach, based on the dialog box type mfc more practical
- 2022-04-02 09:28:51下载
- 积分:1
-
enhanced netstat.可以找出端口对应的进程PID,从而确定某个端口是由哪个程序打开的。对于二次开发很有用。...
enhanced netstat.可以找出端口对应的进程PID,从而确定某个端口是由哪个程序打开的。对于二次开发很有用。-enhanced netstat. Ports can find the corresponding process PID, a port in order to determine which procedures are open. For the Second Development useful.
- 2022-07-08 09:17:54下载
- 积分:1
-
C语言写的端口转发工具,内附源代码
C语言写的端口转发工具,内附源代码-Written by C language port forward instrument, containing the source code
- 2022-03-20 11:28:45下载
- 积分:1