Interface CrcAlgorithm

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CrcSize getCrcSize()
      Gets the CrcSize class to which this CrcAlgorithm belongs.
      byte[] toCrcBytes​(byte[] aData, int aOffset, int aLength, Endianess aEndianess)
      Calculates the according checksum from the supplied data data and returns the according byte array of the CRC checksum.
      byte[] toCrcBytes​(byte[] aData, Endianess aEndianess)
      Calculates the according checksum from the supplied data data and returns the according byte array of the CRC checksum.
      byte[] toCrcBytes​(byte aData, Endianess aEndianess)
      Calculates the according checksum from the supplied data and returns the according byte array of the CRC checksum.
      byte[] toCrcBytes​(long aCrc, byte[] aData, int aOffset, int aLength, Endianess aEndianess)
      Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
      byte[] toCrcBytes​(long aCrc, byte[] aData, Endianess aEndianess)
      Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
      byte[] toCrcBytes​(long aCrc, byte aData, Endianess aEndianess)
      Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
      long toCrcChecksum​(byte aData)
      Calculates the according checksum from the supplied data.
      long toCrcChecksum​(byte[] aData)
      Calculates the according checksum from the supplied data.
      long toCrcChecksum​(byte[] aData, int aOffset, int aLength)
      Calculates the according checksum from the supplied data.
      long toCrcChecksum​(long aCrc, byte aData)
      Updates the according checksum with he supplied data.
      long toCrcChecksum​(long aCrc, byte[] aData)
      Updates the according checksum with he supplied data.
      long toCrcChecksum​(long aCrc, byte[] aData, int aOffset, int aLength)
      Updates the according checksum with he supplied data.
      • Methods inherited from interface org.refcodes.mixin.NameAccessor

        getName
    • Method Detail

      • getCrcSize

        CrcSize getCrcSize()
        Gets the CrcSize class to which this CrcAlgorithm belongs.
        Returns:
        The CrcSize enumeration providing various width related methods.
      • toCrcChecksum

        long toCrcChecksum​(byte aData)
        Calculates the according checksum from the supplied data.
        Parameters:
        aData - The data for which to calculate the checksum.
        Returns:
        The according checksum.
      • toCrcChecksum

        long toCrcChecksum​(long aCrc,
                           byte aData)
        Updates the according checksum with he supplied data.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        Returns:
        The accordingly updated checksum.
      • toCrcChecksum

        long toCrcChecksum​(byte[] aData)
        Calculates the according checksum from the supplied data.
        Parameters:
        aData - The data for which to calculate the checksum.
        Returns:
        The according checksum.
      • toCrcChecksum

        long toCrcChecksum​(long aCrc,
                           byte[] aData)
        Updates the according checksum with he supplied data.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        Returns:
        The accordingly updated checksum.
      • toCrcChecksum

        long toCrcChecksum​(byte[] aData,
                           int aOffset,
                           int aLength)
        Calculates the according checksum from the supplied data.
        Parameters:
        aData - The data for which to calculate the checksum.
        aOffset - The offset from where to start.
        aLength - The number of bytes to cover.
        Returns:
        The according checksum.
      • toCrcChecksum

        long toCrcChecksum​(long aCrc,
                           byte[] aData,
                           int aOffset,
                           int aLength)
        Updates the according checksum with he supplied data.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        aOffset - The offset from where to start.
        aLength - The number of bytes to cover.
        Returns:
        The accordingly updated checksum.
      • toCrcBytes

        byte[] toCrcBytes​(byte aData,
                          Endianess aEndianess)
        Calculates the according checksum from the supplied data and returns the according byte array of the CRC checksum.
        Parameters:
        aData - The data for which to calculate the checksum.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The according checksum.
      • toCrcBytes

        byte[] toCrcBytes​(long aCrc,
                          byte aData,
                          Endianess aEndianess)
        Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The accordingly updated checksum.
      • toCrcBytes

        byte[] toCrcBytes​(byte[] aData,
                          Endianess aEndianess)
        Calculates the according checksum from the supplied data data and returns the according byte array of the CRC checksum.
        Parameters:
        aData - The data for which to calculate the checksum.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The according checksum.
      • toCrcBytes

        byte[] toCrcBytes​(long aCrc,
                          byte[] aData,
                          Endianess aEndianess)
        Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The accordingly updated checksum.
      • toCrcBytes

        byte[] toCrcBytes​(byte[] aData,
                          int aOffset,
                          int aLength,
                          Endianess aEndianess)
        Calculates the according checksum from the supplied data data and returns the according byte array of the CRC checksum.
        Parameters:
        aData - The data for which to calculate the checksum.
        aOffset - The offset from where to start.
        aLength - The number of bytes to cover.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The according checksum.
      • toCrcBytes

        byte[] toCrcBytes​(long aCrc,
                          byte[] aData,
                          int aOffset,
                          int aLength,
                          Endianess aEndianess)
        Updates the according checksum with he supplied data data and returns the according byte array of the CRC checksum.
        Parameters:
        aCrc - The CRC checksum to be updated.
        aData - The data for which to calculate the checksum.
        aOffset - The offset from where to start.
        aLength - The number of bytes to cover.
        aEndianess - The Endianess (big endian or little endian) of the resulting bytes representing the CRC checksum.
        Returns:
        The accordingly updated checksum.