请输入您要查询的百科知识:

 

词条 SYSV checksum
释义

  1. Newer checksum algorithms

  2. Description of the algorithm

  3. Sources

{{short description|A commonly used, legacy checksum algorithm}}

The SYSV checksum algorithm is a commonly used, legacy checksum algorithm.

It has been implemented in UNIX System V and is also available through the GNU sum command line utility.

Newer checksum algorithms

The manual page of the GNU sum utility program (that implements the BSD checksum algorithm) states:

"sum is provided for compatibility; the cksum program is preferable in new applications."

Description of the algorithm

The main part of this algorithm is simply adding up all bytes in a 32-bit sum. As a result, this algorithm has the characteristics (disadvantages and advantages) of a simple sum:

  • re-arranging the same bytes in another order (e.g. moving text from one place to another place) does not change the checksum.
  • increasing one byte and decreasing another byte by the same amount does not change the checksum.
  • adding or removing zero bytes does not change the checksum.

As a result, many common changes to text data are not detected by this method.

The last two lines of the algorithm reduce the total sum to a 16-bit number.

Sources

  • [https://www.gnu.org/software/coreutils/manual/html_node/sum-invocation.html official GNU sum manual page]
  • [https://www.gnu.org/software/coreutils/ coreutils download page] --- find and unpack the newest version of the coreutils package, read src/sum.c

1 : Checksum algorithms

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 0:14:40