Class CRC64


  • public class CRC64
    extends java.lang.Object
    This class provides 64-bit CRCs for strings and byte arrays. It uses the primitive polynomial x64+x4+x3+x+1.
    Version:
    $Id$
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long compute​(byte[] x)
      Computes the 64 bit CRC of a byte array.
      static long compute​(char[] x, int l)
      Computes the 64 bit CRC of a character array for a given length.
      static long compute​(char[] x, int off, int len)
      Computes the 64 bit CRC of a character array for a given length.
      static long compute​(it.unimi.dsi.lang.MutableString s)
      Computes the 64 bit CRC of a string, using the ISO8859-1 representation of its Unicode characters.
      static long compute​(java.lang.String s)
      Computes the 64 bit CRC of a string, using the ISO8859-1 representation of its Unicode characters.
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • compute

        public static long compute​(byte[] x)
        Computes the 64 bit CRC of a byte array.
        Parameters:
        x - the byte array to CRC.
        Returns:
        the CRC.
      • compute

        public static long compute​(char[] x,
                                   int off,
                                   int len)
        Computes the 64 bit CRC of a character array for a given length.
        Parameters:
        x - the array to CRC.
        off - the offset inside x.
        len - the number of characters to use.
        Returns:
        the CRC.
      • compute

        public static long compute​(char[] x,
                                   int l)
        Computes the 64 bit CRC of a character array for a given length.
        Parameters:
        x - the array to CRC.
        l - the number of characters to use.
        Returns:
        the CRC.
      • compute

        public static long compute​(java.lang.String s)
        Computes the 64 bit CRC of a string, using the ISO8859-1 representation of its Unicode characters.
        Parameters:
        s - the byte array to CRC.
        Returns:
        the CRC.
      • compute

        public static long compute​(it.unimi.dsi.lang.MutableString s)
        Computes the 64 bit CRC of a string, using the ISO8859-1 representation of its Unicode characters.
        Parameters:
        s - the byte array to CRC.
        Returns:
        the CRC.
      • main

        public static void main​(java.lang.String[] args)