java.lang.Object
org.seppiko.commons.utils.crypto.crc.CRC24
All Implemented Interfaces:
Checksum

public class CRC24 extends Object implements Checksum
CRC-24 implementation as described in RFC4880.
Author:
Leonard Woo
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create CRC-24 instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the current checksum value.
    void
    Resets the checksum to its initial value.
    void
    update(byte[] b, int off, int len)
    Updates the current checksum with the specified array of bytes.
    void
    update(int b)
    Updates the current checksum with the specified byte.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.zip.Checksum

    update, update
  • Constructor Details

    • CRC24

      public CRC24()
      Create CRC-24 instance.
  • Method Details

    • update

      public void update(int b)
      Updates the current checksum with the specified byte.
      Specified by:
      update in interface Checksum
      Parameters:
      b - the byte to update the checksum with.
    • update

      public void update(byte[] b, int off, int len)
      Updates the current checksum with the specified array of bytes.
      Specified by:
      update in interface Checksum
      Parameters:
      b - the byte array to update the checksum with.
      off - the start offset of the data.
      len - the number of bytes to use for the update.
    • getValue

      public long getValue()
      Returns the current checksum value.
      Specified by:
      getValue in interface Checksum
      Returns:
      the current checksum value.
    • reset

      public void reset()
      Resets the checksum to its initial value.
      Specified by:
      reset in interface Checksum