Skip to content

Commit bb98f65

Browse files
committed
Javadoc
1 parent ad15751 commit bb98f65

File tree

1 file changed

+9
-0
lines changed
  • src/main/java/org/apache/commons/codec/digest

1 file changed

+9
-0
lines changed

src/main/java/org/apache/commons/codec/digest/CRC16.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
* <p>
2727
* Since there are so many CRC-16 variants, we do not pick a default.
2828
* </p>
29+
* <p>
30+
* To create a create a custom variant of CRC16-MODBUS with a init value of {@code 0x0000}, call:
31+
* </p>
32+
* <pre>
33+
* Checksum crc16 = CRC16.builder()
34+
* .setTable(CRC16.getModbusTable())
35+
* .setInit(0x0000)
36+
* .get();
37+
* </pre>
2938
*
3039
* @see <a href="https://en.wikipedia.org/wiki/Cyclic_redundancy_check">Cyclic redundancy check</a>
3140
* @see <a href="https://reveng.sourceforge.io/crc-catalogue/16.htm">Catalogue of parametrised CRC algorithms with 16 bits</a>

0 commit comments

Comments
 (0)