Class CRC64

java.lang.Object
it.unimi.dsi.webgraph.webbase.CRC64

public class CRC64 extends 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

    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
    Computes the 64 bit CRC of a string, using the ISO8859-1 representation of its Unicode characters.

    Methods inherited from class java.lang.Object

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

    • 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(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.