Module lettuce.core

Class CRC16

java.lang.Object
io.lettuce.core.codec.CRC16

public class CRC16
extends Object
Since:
3.0
Author:
Mark Paluch
  • Name: XMODEM (also known as ZMODEM or CRC-16/ACORN)
  • Width: 16 bit
  • Poly: 1021-2020 (That is actually x16 + x12 + x5 + 1)
  • Initialization: 0000
  • Reflect Input byte: False
  • Reflect Output CRC: False
  • Xor constant to output CRC: 0000
  • Method Details

    • crc16

      public static int crc16​(byte[] bytes)
      Create a CRC16 checksum from the bytes.
      Parameters:
      bytes - input bytes
      Returns:
      CRC16 as integer value
    • crc16

      public static int crc16​(byte[] bytes, int off, int len)
      Create a CRC16 checksum from the bytes.
      Parameters:
      bytes - input bytes
      Returns:
      CRC16 as integer value
    • crc16

      public static int crc16​(ByteBuffer bytes)
      Create a CRC16 checksum from the bytes.
      Parameters:
      bytes - input bytes
      Returns:
      CRC16 as integer value
      Since:
      4.4