Package it.unimi.dsi.webgraph.webbase
Class CRC64
java.lang.Object
it.unimi.dsi.webgraph.webbase.CRC64
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 TypeMethodDescriptionstatic 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.
-
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 insidex
.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
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.
-