Skip to content

Commit 3b7b68b

Browse files
authored
Merge pull request #30 from ivanpanch/patch-1
Fix mistakes
2 parents 75146a9 + 9dfc404 commit 3b7b68b

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

doc/crc.qbk

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
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
2424
integrity after transmission. The [*Boost.CRC] library provides access to two
2525
styles of CRC computation, one as a function template, the other as a function
2626
template 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

5858
The check values are known as [*checksum]s because they are used to /check/ for
5959
data 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

8080
For a given degree /x/ for the modulo-2 polynomial divisor, the remainder will
8181
have 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/
8484
bits in *width*.
8585

8686
The 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
9595
term of the dividend polynomial. Long division can be processed in piecemeal,
9696
reading new upper terms as needed. This maps to reading the data a byte (or
9797
bit) 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

100100
Long 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
102102
thing that has to change during each division step; a new input byte (or bit) is
103103
combined with the remainder to make the interim dividend, and then combined with
104104
the 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
140140
that the lowest- and highest-order bits swap states, the next-lowest- and
141141
next-highest-order bits swap, etc. The input reflection can be done by
142142
reflecting 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
144144
done in the real world, since it's a one-time cost, unlike reflecting the bytes.
145145

146146
Similarly, 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
148148
reflection* is in effect.
149149

150150
Some CRCs don't return the remainder directly (reflected or not), but add an
151151
extra 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
153153
mask of all 1-values (of the same bit length as the remainder). Some systems
154154
use a *final XOR mask* that isn't all 1-values, for variety. (This mask takes
155155
place /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
314314
default-constructed, giving it the same behavior as a `crc_basic` object with
315315
the 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.]
317317
without permanently affecting the initial-remainder attribute.
318318

319319
Besides 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

342342
The major difference between `crc_basic` and `crc_optimal` is the internals.
343343
Objects from `crc_basic` run their CRC algorithm one bit at a time, no matter
344344
which 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/
346346
only justifies using part of a single byte.], use a byte-indexed table-driven CRC
347347
algorithm which is a *lot* faster than processing individual bits.
348348

include/boost/crc.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ crc_basic<Bits>::get_final_xor_value
16701670
return final_;
16711671
}
16721672

1673-
/** Returns a whether or not a submitted byte will be \"reflected\" before it is
1673+
/** Returns whether or not a submitted byte will be \"reflected\" before it is
16741674
used to update the interim remainder. Only the byte-wise operations
16751675
#process_byte, #process_block, and #process_bytes are affected.
16761676
@@ -1776,7 +1776,7 @@ crc_basic<Bits>::reset
17761776
17771777
\param[in] bit The new input bit.
17781778
1779-
\post The interim remainder is updated though a modulo-2 polynomial
1779+
\post The interim remainder is updated through a modulo-2 polynomial
17801780
division, where the division steps are altered for unaugmented CRCs.
17811781
*/
17821782
template < std::size_t Bits >
@@ -1801,7 +1801,7 @@ crc_basic<Bits>::process_bit
18011801
\param[in] bits The byte containing the new input bits.
18021802
\param[in] bit_length The number of bits in the byte to be read.
18031803
1804-
\post The interim remainder is updated though \a bit_length modulo-2
1804+
\post The interim remainder is updated through \a bit_length modulo-2
18051805
polynomial divisions, where the division steps are altered for unaugmented
18061806
CRCs.
18071807
*/
@@ -1831,7 +1831,7 @@ crc_basic<Bits>::process_bits
18311831
18321832
\param[in] byte The new input byte.
18331833
1834-
\post The interim remainder is updated though \c CHAR_BIT modulo-2
1834+
\post The interim remainder is updated through \c CHAR_BIT modulo-2
18351835
polynomial divisions, where the division steps are altered for unaugmented
18361836
CRCs.
18371837
*/
@@ -1865,7 +1865,7 @@ crc_basic<Bits>::process_byte
18651865
\param[in] bytes_end Points to one-byte past the address of the memory
18661866
block's last byte, or \a bytes_begin if no bytes are to be read.
18671867
1868-
\post The interim remainder is updated though <code>CHAR_BIT * (((unsigned
1868+
\post The interim remainder is updated through <code>CHAR_BIT * (((unsigned
18691869
char const *) bytes_end) - ((unsigned char const *) bytes_begin))</code>
18701870
modulo-2 polynomial divisions, where the division steps are altered for
18711871
unaugmented CRCs.
@@ -1901,7 +1901,7 @@ crc_basic<Bits>::process_block
19011901
\param[in] buffer The address where the memory block begins.
19021902
\param[in] byte_count The number of bytes in the memory block.
19031903
1904-
\post The interim remainder is updated though <code>CHAR_BIT *
1904+
\post The interim remainder is updated through <code>CHAR_BIT *
19051905
<var>byte_count</var></code> modulo-2 polynomial divisions, where the
19061906
division steps are altered for unaugmented CRCs.
19071907
*/
@@ -2171,7 +2171,7 @@ BOOST_CRC_OPTIMAL_NAME::checksum
21712171
21722172
\param[in] byte The new input byte.
21732173
2174-
\post The interim remainder is updated though \c CHAR_BIT modulo-2
2174+
\post The interim remainder is updated through \c CHAR_BIT modulo-2
21752175
polynomial divisions, where the division steps are altered for unaugmented
21762176
CRCs.
21772177
@@ -2253,7 +2253,7 @@ BOOST_CRC_OPTIMAL_NAME::operator ()
22532253
22542254
\note Unaugmented-style CRC runs perform modulo-2 polynomial division in
22552255
an altered order. The trailing \a Bits number of zero-valued bits needed
2256-
to extracted an (unprocessed) checksum is virtually moved to near the
2256+
to extract an (unprocessed) checksum is virtually moved to near the
22572257
beginning of the message. This is OK since the XOR operation is
22582258
commutative and associative. It also means that you can get a checksum
22592259
anytime. Since data is being read byte-wise, a table of pre-computed

0 commit comments

Comments
 (0)