2020
2121[section:motivation What is Boost.CRC?]
2222
23- CRCs (cyclic redundancy codes) is one common technique to confirming data
23+ CRCs (cyclic redundancy codes) are one common technique to confirming data
2424integrity after transmission. The [*Boost.CRC] library provides access to two
2525styles of CRC computation, one as a function template, the other as a function
2626template and two computation object class templates, where the two class
@@ -46,7 +46,7 @@ There are several possibilities after the receiver's check:
4646
4747* The check value matches at both places and the data was transmitted intact.
4848* The data got corrupted and the check values do not match.
49- * The data is intact, but the check value got corrupted. This can't the
49+ * The data is intact, but the check value got corrupted. This can't be
5050 distinguished from the previous case, but is a (relatively) safe false
5151 positive.
5252* Either the data and/or check value gets corrupted, but such that the results
@@ -57,7 +57,7 @@ lot of churn per input, especially a variable amount.
5757
5858The check values are known as [*checksum]s because they are used to /check/ for
5959data consistency and the first coding algorithms were addition- (i.e.
60- ['sum]ming-) based.
60+ ['sum]ming-)based.
6161
6262[section:intro_crcs CRCs]
6363
@@ -79,8 +79,8 @@ checksum.
7979
8080For a given degree /x/ for the modulo-2 polynomial divisor, the remainder will
8181have at most /x/ terms (from degree /x/ - 1 down to the constant term). The
82- coefficients are modulo-2, which means that they can be represented by 0's and
83- 1's . So a remainder can be modeled by an (unsigned) integer of at least /x/
82+ coefficients are modulo-2, which means that they can be represented by 0s and
83+ 1s . So a remainder can be modeled by an (unsigned) integer of at least /x/
8484bits in *width*.
8585
8686The divisor must have its /x/ degree term be one, which means it is always known
@@ -95,10 +95,10 @@ the input stream of data bits, where each new incoming bit is the next lower
9595term of the dividend polynomial. Long division can be processed in piecemeal,
9696reading new upper terms as needed. This maps to reading the data a byte (or
9797bit) at a time, generating updated remainders just-in-time, without needing to
98- read (and/or store(!)) the entire data message at once.
98+ read (and/or store (!)) the entire data message at once.
9999
100100Long division involves appending new dividend terms after the previous terms
101- have been processed into the (interim) remainder. So the remainder it the only
101+ have been processed into the (interim) remainder. So the remainder is the only
102102thing that has to change during each division step; a new input byte (or bit) is
103103combined with the remainder to make the interim dividend, and then combined with
104104the partial product (based on the divisor and top dividend bit(s)) to become a
@@ -140,16 +140,16 @@ applied. Reflecting a built-in integer reverses the order of its bits, such
140140that the lowest- and highest-order bits swap states, the next-lowest- and
141141next-highest-order bits swap, etc. The input reflection can be done by
142142reflecting each byte as it comes in or keeping the bytes unchanged but reflect
143- the other internal functioning. The latter sounds harder, but what it usually
143+ the other internal functioning. The latter sounds harder, but is what is usually
144144done in the real world, since it's a one-time cost, unlike reflecting the bytes.
145145
146146Similarly, the final remainder is processed by some hardware in reverse order,
147- which means software that simulate such systems need to flag that *output
147+ which means software that simulates such systems needs to flag that *output
148148reflection* is in effect.
149149
150150Some CRCs don't return the remainder directly (reflected or not), but add an
151151extra step complementing the output bits. Complementing turns 1 values into 0
152- values and vice versa. This can simulated by using a XOR (exclusive-or) bit
152+ values and vice versa. This can be simulated by using a XOR (exclusive-or) bit
153153mask of all 1-values (of the same bit length as the remainder). Some systems
154154use a *final XOR mask* that isn't all 1-values, for variety. (This mask takes
155155place /after/ any output reflection.)
@@ -192,7 +192,7 @@ the specification points of a given CRC system (quoted):
192192 final value in the register is fed into the XOROUT stage directly,
193193 otherwise, if this parameter is TRUE, the final register value is
194194 reflected first.]]
195- [[XOROUT] [This is an W-bit value that should be specified as a
195+ [[XOROUT] [This is a W-bit value that should be specified as a
196196 hexadecimal number. It is XORed to the final register value (after
197197 the REFOUT) stage before the value is returned as the official
198198 checksum.]]
@@ -313,7 +313,7 @@ field in the same relative order they were in the `crc_basic` constructor.
313313(Some parameters have defaults.) Objects based from `crc_optimal` can either be
314314default-constructed, giving it the same behavior as a `crc_basic` object with
315315the equivalent settings, or use one parameter, which overrides the initial
316- remainder value[footnote i.e. The interim-remainder before any input is read.]
316+ remainder value[footnote i.e. the interim-remainder before any input is read.]
317317without permanently affecting the initial-remainder attribute.
318318
319319Besides template parameters and construction, `crc_optimal` differs from
@@ -337,12 +337,12 @@ Besides template parameters and construction, `crc_optimal` differs from
337337 algorithms that expect generator objects[footnote Albeit this object won't
338338 change its return value within code that only uses it as a generator.].
339339* Merging the two `reset` member functions into one. (It uses a single
340- parameter that can have a default argument).
340+ parameter that can have a default argument.)
341341
342342The major difference between `crc_basic` and `crc_optimal` is the internals.
343343Objects from `crc_basic` run their CRC algorithm one bit at a time, no matter
344344which unit is used as input. Objects from `crc_optimal`, when /WIDTH/ is at
345- least `CHAR_BIT`[footnote i.e. The optimizations are suspended if the /WIDTH/
345+ least `CHAR_BIT`[footnote i.e., the optimizations are suspended if the /WIDTH/
346346only justifies using part of a single byte.], use a byte-indexed table-driven CRC
347347algorithm which is a *lot* faster than processing individual bits.
348348
0 commit comments