diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0e98de..9377a74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,27 +5,31 @@ on: - ea - develop pull_request: - types: [opened, synchronize, reopened] + types: [ opened, synchronize, reopened ] +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: build: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: temurin + java-version: 17 - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java index 4630de8..d28cd86 100644 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import java.net.*; import java.io.*; import java.nio.channels.*; @@ -25,7 +26,7 @@ public class MavenWrapperDownloader { * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" - + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; /** * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to @@ -54,7 +55,7 @@ public static void main(String args[]) { // wrapperUrl parameter. File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); String url = DEFAULT_DOWNLOAD_URL; - if(mavenWrapperPropertyFile.exists()) { + if (mavenWrapperPropertyFile.exists()) { FileInputStream mavenWrapperPropertyFileInputStream = null; try { mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); @@ -65,7 +66,7 @@ public static void main(String args[]) { System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); } finally { try { - if(mavenWrapperPropertyFileInputStream != null) { + if (mavenWrapperPropertyFileInputStream != null) { mavenWrapperPropertyFileInputStream.close(); } } catch (IOException e) { @@ -76,8 +77,8 @@ public static void main(String args[]) { System.out.println("- Downloading from: " + url); File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if(!outputFile.getParentFile().exists()) { - if(!outputFile.getParentFile().mkdirs()) { + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); } diff --git a/.travis.yml b/.travis.yml index c14e3a5..632009f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,16 +32,16 @@ jobs: - arch: s390x jdk: openjdk7 # target release on big-endian machine install: - - wget -O ibmjdk7.bin -q -T 10 -t 5 https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.1.4.85/linux/s390x/ibm-java-sdk-7.1-4.85-s390x-archive.bin - - echo "6a901bc0b713582a323481d5b41d0c289cbd6fbb265eefb4962080240fe59ff2 ibmjdk7.bin" | sha256sum -c - - - chmod +x ibmjdk7.bin - - echo "INSTALLER_UI=silent" > response.properties - - echo "USER_INSTALL_DIR=$PWD/ibmjdk7" >> response.properties - - echo "LICENSE_ACCEPTED=TRUE" >> response.properties - - ./ibmjdk7.bin -i silent -f response.properties - - export PATH="$PWD/ibmjdk7/bin:$PATH" - - export JAVA_HOME="$PWD/ibmjdk7" - - java -version + - wget -O ibmjdk7.bin -q -T 10 -t 5 https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.1.4.85/linux/s390x/ibm-java-sdk-7.1-4.85-s390x-archive.bin + - echo "6a901bc0b713582a323481d5b41d0c289cbd6fbb265eefb4962080240fe59ff2 ibmjdk7.bin" | sha256sum -c - + - chmod +x ibmjdk7.bin + - echo "INSTALLER_UI=silent" > response.properties + - echo "USER_INSTALL_DIR=$PWD/ibmjdk7" >> response.properties + - echo "LICENSE_ACCEPTED=TRUE" >> response.properties + - ./ibmjdk7.bin -i silent -f response.properties + - export PATH="$PWD/ibmjdk7/bin:$PATH" + - export JAVA_HOME="$PWD/ibmjdk7" + - java -version cache: directories: diff --git a/pom.xml b/pom.xml index 078bece..4cd677b 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ - + net.openhft java-parent-pom 2026.0 @@ -239,7 +239,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 1.11.2 + 1.11.2 @@ -258,7 +258,7 @@ - + org.apache.felix maven-bundle-plugin true @@ -309,7 +309,7 @@ 1.${project.target.release} 3.5.1 - + @@ -381,77 +381,5 @@ - - quality - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.6.0 - - - validate - validate - - check - - - - - ${checkstyle.config.location} - true - true - true - ${checkstyle.violationSeverity} - - - - com.puppycrawl.tools - checkstyle - 10.26.1 - - - net.openhft - chronicle-quality-rules - 1.27.0-SNAPSHOT - - - - - com.github.spotbugs - spotbugs-maven-plugin - - 4.9.8.1 - - Max - Low - true - true - - net/openhft/quality/spotbugs27/chronicle-spotbugs-include.xml - net/openhft/quality/spotbugs27/chronicle-spotbugs-exclude.xml - - - - net.openhft - chronicle-quality-rules - 1.27.0-SNAPSHOT - - - - - spotbugs-main - - process-test-classes - - check - - - - - - - diff --git a/src/main/java-stub/java/lang/Math.java b/src/main/java-stub/java/lang/Math.java index 87a0780..eace44f 100644 --- a/src/main/java-stub/java/lang/Math.java +++ b/src/main/java-stub/java/lang/Math.java @@ -5,13 +5,15 @@ /** * Stub for JDK internal ckass java.lang.Math. - * + *

* - When crossing compiling for Java SE 7 and 8, this stub class can be used for detecting - * Math#multiplyHigh() method at runtime. + * Math#multiplyHigh() method at runtime. * - Only used methods are exported. * - In test and production runtime, the real class is loaded from boot classpath. */ public class Math { - public static long multiplyHigh(long x, long y) { throw new UnsupportedOperationException(); } + public static long multiplyHigh(long x, long y) { + throw new UnsupportedOperationException(); + } } diff --git a/src/main/java-stub/sun/misc/Unsafe.java b/src/main/java-stub/sun/misc/Unsafe.java index b255309..4cafb63 100644 --- a/src/main/java-stub/sun/misc/Unsafe.java +++ b/src/main/java-stub/sun/misc/Unsafe.java @@ -5,22 +5,29 @@ /** * Stub for JDK internal ckass sun.misc.Unsafe. - * + *

* - When crossing compiling for Java SE 7 and 8, this stub class can bypass compiler sun-api - * warnings. + * warnings. * - Only used methods are exported. * - In test and production runtime, the real class is loaded from boot classpath. */ public final class Unsafe { - public native Object getObject( Object o, long offset); - public native int getInt( Object o, long offset); + public native Object getObject(Object o, long offset); + + public native int getInt(Object o, long offset); + public native boolean getBoolean(Object o, long offset); - public native byte getByte( Object o, long offset); - public native short getShort( Object o, long offset); - public native char getChar( Object o, long offset); - public native long getLong( Object o, long offset); + + public native byte getByte(Object o, long offset); + + public native short getShort(Object o, long offset); + + public native char getChar(Object o, long offset); + + public native long getLong(Object o, long offset); public native long objectFieldOffset(java.lang.reflect.Field f); + public native int arrayBaseOffset(Class arrayClass); } diff --git a/src/main/java/net/openhft/hashing/Access.java b/src/main/java/net/openhft/hashing/Access.java index dbe0f05..c1642d1 100644 --- a/src/main/java/net/openhft/hashing/Access.java +++ b/src/main/java/net/openhft/hashing/Access.java @@ -118,10 +118,10 @@ public static Access toNativeCharSequence() { * }} * * @param backingOrder the byte order of {@code char} reads backing - * {@code CharSequences} to access + * {@code CharSequences} to access + * @param the {@code CharSequence} subtype to access * @return the {@code Access} to {@link CharSequence}s backed by {@code char} reads made in * the specified byte order - * @param the {@code CharSequence} subtype to access * @see #toNativeCharSequence() */ @SuppressWarnings("unchecked") @@ -132,15 +132,16 @@ public static Access toCharSequence(ByteOrder backin /** * Constructor for use in subclasses. */ - protected Access() {} + protected Access() { + } /** * Reads {@code [offset, offset + 7]} bytes of the byte sequence represented by the given * {@code input} as a single {@code long} value. * - * @param input the object to access + * @param input the object to access * @param offset offset to the first byte to read within the byte sequence represented - * by the given object + * by the given object * @return eight bytes as a {@code long} value, in {@linkplain #byteOrder(Object) the expected * order} */ @@ -156,9 +157,9 @@ public long getLong(T input, long offset) { * Shortcut for {@code getInt(input, offset) & 0xFFFFFFFFL}. Could be implemented more * efficiently. * - * @param input the object to access + * @param input the object to access * @param offset offset to the first byte to read within the byte sequence represented - * by the given object + * by the given object * @return four bytes as an unsigned int value, in {@linkplain #byteOrder(Object) the expected * order} */ @@ -170,9 +171,9 @@ public long getUnsignedInt(T input, long offset) { * Reads {@code [offset, offset + 3]} bytes of the byte sequence represented by the given * {@code input} as a single {@code int} value. * - * @param input the object to access + * @param input the object to access * @param offset offset to the first byte to read within the byte sequence represented - * by the given object + * by the given object * @return four bytes as an {@code int} value, in {@linkplain #byteOrder(Object) the expected * order} */ @@ -188,9 +189,9 @@ public int getInt(T input, long offset) { * Shortcut for {@code getShort(input, offset) & 0xFFFF}. Could be implemented more * efficiently. * - * @param input the object to access + * @param input the object to access * @param offset offset to the first byte to read within the byte sequence represented - * by the given object + * by the given object * @return two bytes as an unsigned short value, in {@linkplain #byteOrder(Object) the expected * order} */ @@ -206,22 +207,22 @@ public int getUnsignedShort(T input, long offset) { * Reads {@code [offset, offset + 1]} bytes of the byte sequence represented by the given * {@code input} as a single {@code short} value, returned widened to {@code int}. * - * @param input the object to access + * @param input the object to access * @param offset offset to the first byte to read within the byte sequence represented - * by the given object + * by the given object * @return two bytes as a {@code short} value, in {@linkplain #byteOrder(Object) the expected * order}, widened to {@code int} */ public int getShort(T input, long offset) { - return (int) (short) getUnsignedShort(input, offset); + return (short) getUnsignedShort(input, offset); } /** * Shortcut for {@code getByte(input, offset) & 0xFF}. Could be implemented more efficiently. * - * @param input the object to access + * @param input the object to access * @param offset offset to the byte to read within the byte sequence represented - * by the given object + * by the given object * @return a byte by the given {@code offset}, interpreted as unsigned */ public int getUnsignedByte(T input, long offset) { @@ -232,21 +233,41 @@ public int getUnsignedByte(T input, long offset) { * Reads a single byte at the given {@code offset} in the byte sequence represented by the given * {@code input}, returned widened to {@code int}. * - * @param input the object to access + * @param input the object to access * @param offset offset to the byte to read within the byte sequence represented - * by the given object + * by the given object * @return a byte by the given {@code offset}, widened to {@code int} */ public abstract int getByte(T input, long offset); // short names - public long i64(final T input, final long offset) { return getLong(input, offset); } - public long u32(final T input, final long offset) { return getUnsignedInt(input, offset); } - public int i32(final T input, final long offset) { return getInt(input, offset); } - public int u16(final T input, final long offset) { return getUnsignedShort(input, offset); } - public int i16(final T input, final long offset) { return getShort(input, offset); } - public int u8(final T input, final long offset) { return getUnsignedByte(input, offset); } - public int i8(final T input, final long offset) { return getByte(input, offset); } + public long i64(final T input, final long offset) { + return getLong(input, offset); + } + + public long u32(final T input, final long offset) { + return getUnsignedInt(input, offset); + } + + public int i32(final T input, final long offset) { + return getInt(input, offset); + } + + public int u16(final T input, final long offset) { + return getUnsignedShort(input, offset); + } + + public int i16(final T input, final long offset) { + return getShort(input, offset); + } + + public int u8(final T input, final long offset) { + return getUnsignedByte(input, offset); + } + + public int i8(final T input, final long offset) { + return getByte(input, offset); + } /** * The byte order in which all multi-byte {@code getXXX()} reads from the given {@code input} @@ -261,7 +282,7 @@ public int getUnsignedByte(T input, long offset) { * Get {@code this} or the reversed access object for reading the input as fixed * byte order of {@code byteOrder}. * - * @param input the accessed object + * @param input the accessed object * @param byteOrder the byte order to be used for reading the {@code input} * @return a {@code Access} object which will read the {@code input} with the * byte order of {@code byteOrder}. @@ -281,8 +302,8 @@ public Access byteOrder(final T input, final ByteOrder byteOrder) { */ static Access newDefaultReverseAccess(final Access access) { return access instanceof ReverseAccess - ? access.reverseAccess() - : new ReverseAccess(access); + ? access.reverseAccess() + : new ReverseAccess(access); } /** @@ -290,41 +311,51 @@ static Access newDefaultReverseAccess(final Access access) { */ private static class ReverseAccess extends Access { final Access access; + private ReverseAccess(final Access access) { this.access = access; } + @Override public long getLong(final T input, final long offset) { return Long.reverseBytes(access.getLong(input, offset)); } + @Override public long getUnsignedInt(final T input, final long offset) { return Long.reverseBytes(access.getUnsignedInt(input, offset)) >>> 32; } + @Override public int getInt(final T input, final long offset) { return Integer.reverseBytes(access.getInt(input, offset)); } + @Override public int getUnsignedShort(final T input, final long offset) { return Integer.reverseBytes(access.getUnsignedShort(input, offset)) >>> 16; } + @Override public int getShort(final T input, final long offset) { return Integer.reverseBytes(access.getShort(input, offset)) >> 16; } + @Override public int getUnsignedByte(final T input, final long offset) { return access.getUnsignedByte(input, offset); } + @Override public int getByte(final T input, final long offset) { return access.getByte(input, offset); } + @Override public ByteOrder byteOrder(final T input) { return LITTLE_ENDIAN == access.byteOrder(input) ? BIG_ENDIAN : LITTLE_ENDIAN; } + @Override protected Access reverseAccess() { return access; diff --git a/src/main/java/net/openhft/hashing/ByteBufferAccess.java b/src/main/java/net/openhft/hashing/ByteBufferAccess.java index a87848f..4b7f88a 100644 --- a/src/main/java/net/openhft/hashing/ByteBufferAccess.java +++ b/src/main/java/net/openhft/hashing/ByteBufferAccess.java @@ -10,7 +10,8 @@ public final class ByteBufferAccess extends Access { public static final ByteBufferAccess INSTANCE = new ByteBufferAccess(); private static final Access INSTANCE_REVERSE = Access.newDefaultReverseAccess(INSTANCE); - private ByteBufferAccess() {} + private ByteBufferAccess() { + } @Override public long getLong(ByteBuffer input, long offset) { diff --git a/src/main/java/net/openhft/hashing/CharSequenceAccess.java b/src/main/java/net/openhft/hashing/CharSequenceAccess.java index 36a452a..aea03aa 100644 --- a/src/main/java/net/openhft/hashing/CharSequenceAccess.java +++ b/src/main/java/net/openhft/hashing/CharSequenceAccess.java @@ -28,7 +28,7 @@ protected static long getLong(CharSequence input, long offset, int char0Off, int char1Off, int char2Off, int char3Off, int char4Off, int delta) { final int base = ix(offset); - if (0 == ((int)offset & 1)) { + if (0 == ((int) offset & 1)) { final long char0 = input.charAt(base + char0Off); final long char1 = input.charAt(base + char1Off); final long char2 = input.charAt(base + char2Off); @@ -47,7 +47,7 @@ protected static long getLong(CharSequence input, long offset, protected static long getUnsignedInt(CharSequence input, long offset, int char0Off, int char1Off, int char2Off, int delta) { final int base = ix(offset); - if (0 == ((int)offset & 1)) { + if (0 == ((int) offset & 1)) { final long char0 = input.charAt(base + char0Off); final long char1 = input.charAt(base + char1Off); return char0 | (char1 << 16); @@ -61,13 +61,13 @@ protected static long getUnsignedInt(CharSequence input, long offset, protected static char getUnsignedShort(CharSequence input, long offset, int char1Off, int delta) { - if (0 == ((int)offset & 1)) { + if (0 == ((int) offset & 1)) { return input.charAt(ix(offset)); } else { final int base = ix(offset); final int char0 = input.charAt(base + delta) >>> 8; final int char1 = input.charAt(base + char1Off); - return (char)(char0 | (char1 << 8)); + return (char) (char0 | (char1 << 8)); } } @@ -75,7 +75,8 @@ protected static int getUnsignedByte(CharSequence input, long offset, int shift) return Primitives.unsignedByte(input.charAt(ix(offset)) >> shift); } - private CharSequenceAccess() {} + private CharSequenceAccess() { + } @Override public int getInt(CharSequence input, long offset) { @@ -84,7 +85,7 @@ public int getInt(CharSequence input, long offset) { @Override public int getShort(CharSequence input, long offset) { - return (int)(short)getUnsignedShort(input, offset); + return (int) (short) getUnsignedShort(input, offset); } @Override @@ -96,7 +97,8 @@ private static class LittleEndianCharSequenceAccess extends CharSequenceAccess { private static final CharSequenceAccess INSTANCE = new LittleEndianCharSequenceAccess(); private static final Access INSTANCE_REVERSE = Access.newDefaultReverseAccess(INSTANCE); - private LittleEndianCharSequenceAccess() {} + private LittleEndianCharSequenceAccess() { + } @Override public long getLong(CharSequence input, long offset) { @@ -133,7 +135,8 @@ private static class BigEndianCharSequenceAccess extends CharSequenceAccess { private static final CharSequenceAccess INSTANCE = new BigEndianCharSequenceAccess(); private static final Access INSTANCE_REVERSE = Access.newDefaultReverseAccess(INSTANCE); - private BigEndianCharSequenceAccess() {} + private BigEndianCharSequenceAccess() { + } @Override public long getLong(CharSequence input, long offset) { diff --git a/src/main/java/net/openhft/hashing/CityAndFarmHash_1_1.java b/src/main/java/net/openhft/hashing/CityAndFarmHash_1_1.java index 9908f0c..69d64f4 100644 --- a/src/main/java/net/openhft/hashing/CityAndFarmHash_1_1.java +++ b/src/main/java/net/openhft/hashing/CityAndFarmHash_1_1.java @@ -538,7 +538,7 @@ static long uoHash64WithSeeds(Access access, T in, long off, long len, lo a += access.i64(in, off + 8); a += access.i64(in, off + 16); b += rotateRight(a, 44); - v0 = a + z1; + v0 = a + z1; v1 = b + c; long a1 = z + w1; diff --git a/src/main/java/net/openhft/hashing/CompactLatin1CharSequenceAccess.java b/src/main/java/net/openhft/hashing/CompactLatin1CharSequenceAccess.java index ceb41f4..e23b4e2 100644 --- a/src/main/java/net/openhft/hashing/CompactLatin1CharSequenceAccess.java +++ b/src/main/java/net/openhft/hashing/CompactLatin1CharSequenceAccess.java @@ -3,13 +3,11 @@ */ package net.openhft.hashing; -import java.nio.ByteOrder; - import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; + import javax.annotation.ParametersAreNonnullByDefault; +import java.nio.ByteOrder; -import static java.nio.ByteOrder.BIG_ENDIAN; import static java.nio.ByteOrder.LITTLE_ENDIAN; import static net.openhft.hashing.UnsafeAccess.BYTE_BASE; @@ -89,11 +87,12 @@ public class CompactLatin1CharSequenceAccess extends Access { private static final UnsafeAccess UNSAFE = UnsafeAccess.INSTANCE; private static final long UNSAFE_IDX_ADJUST - = BYTE_BASE * 2L + (ByteOrder.nativeOrder() == LITTLE_ENDIAN ? 1 : 0); + = BYTE_BASE * 2L + (ByteOrder.nativeOrder() == LITTLE_ENDIAN ? 1 : 0); private static final long ARRAY_IDX_ADJUST - = ByteOrder.nativeOrder() == LITTLE_ENDIAN ? 1 : 0; + = ByteOrder.nativeOrder() == LITTLE_ENDIAN ? 1 : 0; - private CompactLatin1CharSequenceAccess() {} + private CompactLatin1CharSequenceAccess() { + } @Override public long getLong(final byte[] input, final long offset) { @@ -101,7 +100,7 @@ public long getLong(final byte[] input, final long offset) { final long compact = UNSAFE.getUnsignedInt(input, byteIdx); long expanded = ((compact << 16) | compact) & 0xFFFF0000FFFFL; expanded = ((expanded << 8) | expanded) & 0xFF00FF00FF00FFL; - if (((int)offset & 1) == 1) { + if (((int) offset & 1) == 1) { return expanded << 8; } return expanded; @@ -112,7 +111,7 @@ public int getInt(final byte[] input, final long offset) { final long byteIdx = (offset + UNSAFE_IDX_ADJUST) >> 1; final int compact = UNSAFE.getShort(input, byteIdx) & 0xFFFF; final int expanded = ((compact << 8) | compact) & 0xFF00FF; - if (((int)offset & 1) == 1) { + if (((int) offset & 1) == 1) { return expanded << 8; } return expanded; @@ -122,8 +121,8 @@ public int getInt(final byte[] input, final long offset) { public long getUnsignedInt(final byte[] input, final long offset) { final long byteIdx = (offset + UNSAFE_IDX_ADJUST) >> 1; final int compact = UNSAFE.getShort(input, byteIdx) & 0xFFFF; - final long expanded = (long)(((compact << 8) | compact) & 0xFF00FF); - if (((int)offset & 1) == 1) { + final long expanded = (long) (((compact << 8) | compact) & 0xFF00FF); + if (((int) offset & 1) == 1) { return expanded << 8; } return expanded; @@ -131,41 +130,41 @@ public long getUnsignedInt(final byte[] input, final long offset) { @Override public int getShort(final byte[] input, final long offset) { - if (((int)offset & 1) == 0) { - final int byteIdx = (int)(offset >> 1); - return (int)input[byteIdx] & 0xFF; + if (((int) offset & 1) == 0) { + final int byteIdx = (int) (offset >> 1); + return (int) input[byteIdx] & 0xFF; } else { - final int byteIdx = (int)((offset + ARRAY_IDX_ADJUST) >> 1); - return (int)input[byteIdx] << 8; + final int byteIdx = (int) ((offset + ARRAY_IDX_ADJUST) >> 1); + return (int) input[byteIdx] << 8; } } @Override public int getUnsignedShort(final byte[] input, final long offset) { - if (((int)offset & 1) == 0) { - final int byteIdx = (int)(offset >> 1); - return (int)input[byteIdx] & 0xFF; + if (((int) offset & 1) == 0) { + final int byteIdx = (int) (offset >> 1); + return (int) input[byteIdx] & 0xFF; } else { - final int byteIdx = (int)((offset + ARRAY_IDX_ADJUST) >> 1); - return ((int)input[byteIdx] & 0xFF) << 8; + final int byteIdx = (int) ((offset + ARRAY_IDX_ADJUST) >> 1); + return ((int) input[byteIdx] & 0xFF) << 8; } } @Override public int getByte(final byte[] input, final long offset) { - if (ARRAY_IDX_ADJUST == ((int)offset & 1)) { + if (ARRAY_IDX_ADJUST == ((int) offset & 1)) { return 0; } else { - return (int)input[(int)(offset >> 1)]; + return (int) input[(int) (offset >> 1)]; } } @Override public int getUnsignedByte(final byte[] input, final long offset) { - if (ARRAY_IDX_ADJUST == ((int)offset & 1)) { + if (ARRAY_IDX_ADJUST == ((int) offset & 1)) { return 0; } else { - return (int)input[(int)(offset >> 1)] & 0xFF; + return (int) input[(int) (offset >> 1)] & 0xFF; } } diff --git a/src/main/java/net/openhft/hashing/DualHashFunction.java b/src/main/java/net/openhft/hashing/DualHashFunction.java index e38a89f..2bed535 100644 --- a/src/main/java/net/openhft/hashing/DualHashFunction.java +++ b/src/main/java/net/openhft/hashing/DualHashFunction.java @@ -3,8 +3,9 @@ */ package net.openhft.hashing; -import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import javax.annotation.ParametersAreNonnullByDefault; /** @@ -18,6 +19,7 @@ abstract class DualHashFunction extends LongTupleHashFunction { private static final long serialVersionUID = 0L; private transient final int resultLength = newResultArray().length; + private void checkResult(final long[] result) { if (null == result) { throw new NullPointerException(); @@ -28,6 +30,7 @@ private void checkResult(final long[] result) { } protected abstract long dualHashLong(long input, @Nullable long[] result); + @Override public void hashLong(final long input, final long[] result) { checkResult(result); @@ -35,6 +38,7 @@ public void hashLong(final long input, final long[] result) { } protected abstract long dualHashInt(int input, @Nullable long[] result); + @Override public void hashInt(final int input, final long[] result) { checkResult(result); @@ -42,6 +46,7 @@ public void hashInt(final int input, final long[] result) { } protected abstract long dualHashShort(short input, @Nullable long[] result); + @Override public void hashShort(final short input, final long[] result) { checkResult(result); @@ -49,6 +54,7 @@ public void hashShort(final short input, final long[] result) { } protected abstract long dualHashChar(char input, @Nullable long[] result); + @Override public void hashChar(final char input, final long[] result) { checkResult(result); @@ -56,6 +62,7 @@ public void hashChar(final char input, final long[] result) { } protected abstract long dualHashByte(byte input, @Nullable long[] result); + @Override public void hashByte(final byte input, final long[] result) { checkResult(result); @@ -63,6 +70,7 @@ public void hashByte(final byte input, final long[] result) { } protected abstract long dualHashVoid(@Nullable long[] result); + @Override public void hashVoid(final long[] result) { checkResult(result); @@ -70,11 +78,13 @@ public void hashVoid(final long[] result) { } protected abstract long dualHash(@Nullable T input, Access access, long off, long len, @Nullable long[] result); + @Override public void hash(@Nullable final T input, final Access access, final long off, final long len, final long[] result) { checkResult(result); dualHash(input, access, off, len, result); } + @Override public long[] hash(@Nullable final T input, final Access access, final long off, final long len) { final long[] result = newResultArray(); diff --git a/src/main/java/net/openhft/hashing/HotSpotPrior7u6StringHash.java b/src/main/java/net/openhft/hashing/HotSpotPrior7u6StringHash.java index ee527c1..471efc1 100644 --- a/src/main/java/net/openhft/hashing/HotSpotPrior7u6StringHash.java +++ b/src/main/java/net/openhft/hashing/HotSpotPrior7u6StringHash.java @@ -3,8 +3,8 @@ */ package net.openhft.hashing; -import java.lang.reflect.Field; import javax.annotation.ParametersAreNonnullByDefault; +import java.lang.reflect.Field; @ParametersAreNonnullByDefault enum HotSpotPrior7u6StringHash implements StringHash { @@ -34,7 +34,7 @@ public long longHash(String s, LongHashFunction hashFunction, int off, int len) @Override public void hash(final String s, final LongTupleHashFunction hashFunction, - final int off, final int len, final long[] result) { + final int off, final int len, final long[] result) { final char[] value = (char[]) UnsafeAccess.UNSAFE.getObject(s, valueOffset); final int offset = UnsafeAccess.UNSAFE.getInt(s, offsetOffset); hashFunction.hashChars(value, offset + off, len, result); diff --git a/src/main/java/net/openhft/hashing/LongHashFunction.java b/src/main/java/net/openhft/hashing/LongHashFunction.java index 969efbb..999048e 100644 --- a/src/main/java/net/openhft/hashing/LongHashFunction.java +++ b/src/main/java/net/openhft/hashing/LongHashFunction.java @@ -402,9 +402,9 @@ protected LongHashFunction() { * value is interpreted in {@linkplain ByteOrder#nativeOrder() native} byte order. For example, * the result of {@code hashLong(v)} call is identical to the result of * {@code hashLongs(new long[] {v})} call for any {@code long} value. - * - * @param input the long value to be hashed - * @return the hash code for the given long value + * + * @param input the long value to be hashed + * @return the hash code for the given long value */ public abstract long hashLong(long input); @@ -414,9 +414,9 @@ protected LongHashFunction() { * value is interpreted in {@linkplain ByteOrder#nativeOrder() native} byte order. For example, * the result of {@code hashInt(v)} call is identical to the result of * {@code hashInts(new int[] {v})} call for any {@code int} value. - * - * @param input the int value to be hashed - * @return the hash code for the given int value + * + * @param input the int value to be hashed + * @return the hash code for the given int value */ public abstract long hashInt(int input); @@ -428,9 +428,9 @@ protected LongHashFunction() { * {@code hashShorts(new short[] {v})} call for any {@code short} value. * As a consequence, {@code hashShort(v)} call produce always the same result as {@code * hashChar((char) v)}. - * - * @param input the short value to be hashed - * @return the hash code for the given short value + * + * @param input the short value to be hashed + * @return the hash code for the given short value */ public abstract long hashShort(short input); @@ -442,9 +442,9 @@ protected LongHashFunction() { * {@code hashChars(new char[] {v})} call for any {@code char} value. * As a consequence, {@code hashChar(v)} call produce always the same result as {@code * hashShort((short) v)}. - * - * @param input the char value to be hashed - * @return the hash code for the given char value + * + * @param input the char value to be hashed + * @return the hash code for the given char value */ public abstract long hashChar(char input); @@ -453,17 +453,17 @@ protected LongHashFunction() { * {@code LongHashFunction} methods that accept sequences of bytes. For example, the result of * {@code hashByte(v)} call is identical to the result of * {@code hashBytes(new byte[] {v})} call for any {@code byte} value. - * - * @param input the byte value to be hashed - * @return the hash code for the given byte value + * + * @param input the byte value to be hashed + * @return the hash code for the given byte value */ public abstract long hashByte(byte input); /** * Returns the hash code for the empty (zero-length) bytes sequence, * for example {@code hashBytes(new byte[0])}. - * - * @return the hash code for the empty bytes sequence + * + * @return the hash code for the empty bytes sequence */ public abstract long hashVoid(); @@ -494,9 +494,9 @@ private long unsafeHash(Object input, long off, long len) { * Shortcut for {@link #hashBooleans(boolean[]) hashBooleans(new boolean[] {input})}. * Note that this is not necessarily equal to {@code hashByte(input ? (byte) 1 : (byte) 0)}, * because booleans could be stored differently in this JVM. - * - * @param input the boolean value to be hashed - * @return the hash code for the given boolean value + * + * @param input the boolean value to be hashed + * @return the hash code for the given boolean value */ public long hashBoolean(boolean input) { return hashByte(input ? TRUE_BYTE_VALUE : FALSE_BYTE_VALUE); @@ -504,9 +504,9 @@ public long hashBoolean(boolean input) { /** * Shortcut for {@link #hashBooleans(boolean[], int, int) hashBooleans(input, 0, input.length)}. - * - * @param input the boolean array to be hashed - * @return the hash code for the given boolean array + * + * @param input the boolean array to be hashed + * @return the hash code for the given boolean array */ public long hashBooleans(@NotNull boolean[] input) { return unsafeHash(input, BOOLEAN_BASE, input.length); @@ -532,9 +532,9 @@ public long hashBooleans(@NotNull boolean[] input, int off, int len) { /** * Shortcut for {@link #hashBytes(byte[], int, int) hashBytes(input, 0, input.length)}. - * - * @param input the byte array to be hashed - * @return the hash code for the given byte array + * + * @param input the byte array to be hashed + * @return the hash code for the given byte array */ public long hashBytes(@NotNull byte[] input) { return unsafeHash(input, BYTE_BASE, input.length); @@ -561,9 +561,9 @@ public long hashBytes(@NotNull byte[] input, int off, int len) { /** * Shortcut for {@link #hashBytes(ByteBuffer, int, int) * hashBytes(input, input.position(), input.remaining())}. - * - * @param input the ByteBuffer to be hashed - * @return the hash code for the given ByteBuffer + * + * @param input the ByteBuffer to be hashed + * @return the hash code for the given ByteBuffer */ public long hashBytes(ByteBuffer input) { return hashByteBuffer(input, input.position(), input.remaining()); @@ -616,9 +616,9 @@ public long hashMemory(long address, long len) { /** * Shortcut for {@link #hashChars(char[], int, int) hashChars(input, 0, input.length)}. - * - * @param input the char array to be hashed - * @return the hash code for the given char array + * + * @param input the char array to be hashed + * @return the hash code for the given char array */ public long hashChars(@NotNull char[] input) { return unsafeHash(input, CHAR_BASE, input.length * 2L); @@ -646,9 +646,9 @@ public long hashChars(@NotNull char[] input, int off, int len) { /** * Shortcut for {@link #hashChars(String, int, int) hashChars(input, 0, input.length())}. - * - * @param input the String to be hashed - * @return the hash code for the given String + * + * @param input the String to be hashed + * @return the hash code for the given String */ public long hashChars(@NotNull String input) { return VALID_STRING_HASH.longHash(input, this, 0, input.length()); @@ -758,9 +758,9 @@ public long hashShorts(@NotNull short[] input, int off, int len) { /** * Shortcut for {@link #hashInts(int[], int, int) hashInts(input, 0, input.length)}. - * - * @param input the integer array to be hashed - * @return the hash code for the given integer array + * + * @param input the integer array to be hashed + * @return the hash code for the given integer array */ public long hashInts(@NotNull int[] input) { return unsafeHash(input, INT_BASE, input.length * 4L); @@ -788,9 +788,9 @@ public long hashInts(@NotNull int[] input, int off, int len) { /** * Shortcut for {@link #hashLongs(long[], int, int) hashLongs(input, 0, input.length)}. - * - * @param input the long array to be hashed - * @return the hash code for the given long array + * + * @param input the long array to be hashed + * @return the hash code for the given long array */ public long hashLongs(@NotNull long[] input) { return unsafeHash(input, LONG_BASE, input.length * 8L); diff --git a/src/main/java/net/openhft/hashing/LongTupleHashFunction.java b/src/main/java/net/openhft/hashing/LongTupleHashFunction.java index baa4ba9..235e3c9 100644 --- a/src/main/java/net/openhft/hashing/LongTupleHashFunction.java +++ b/src/main/java/net/openhft/hashing/LongTupleHashFunction.java @@ -5,16 +5,17 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; import sun.nio.ch.DirectBuffer; +import javax.annotation.ParametersAreNonnullByDefault; import java.io.Serializable; import java.nio.ByteBuffer; import java.nio.ByteOrder; import static net.openhft.hashing.CharSequenceAccess.nativeCharSequenceAccess; import static net.openhft.hashing.UnsafeAccess.*; -import static net.openhft.hashing.Util.*; +import static net.openhft.hashing.Util.VALID_STRING_HASH; +import static net.openhft.hashing.Util.checkArrayOffs; /** * Tuple hash function producing more than 64-bit hash code into a result array of type @@ -124,7 +125,8 @@ public static LongTupleHashFunction xx128(final long seed) { /** * Constructor for use in subclasses. */ - protected LongTupleHashFunction() {} + protected LongTupleHashFunction() { + } // Public API // @@ -158,7 +160,7 @@ public long[] newResultArray() { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashLong(long input, long[] result); @@ -188,7 +190,7 @@ public long[] hashLong(final long input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashInt(int input, long[] result); @@ -218,7 +220,7 @@ public long[] hashInt(final int input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashShort(short input, long[] result); @@ -248,7 +250,7 @@ public long[] hashShort(final short input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashChar(char input, long[] result); @@ -277,7 +279,7 @@ public long[] hashChar(final char input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashByte(byte input, long[] result); @@ -304,7 +306,7 @@ public long[] hashByte(final byte input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hashVoid(long[] result); @@ -335,15 +337,15 @@ public long[] hashVoid() { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the object to read bytes from + * @param input the object to read bytes from * @param access access which defines the abstraction of the given input * as ordered byte sequence - * @param off offset to the first byte of the subsequence to hash - * @param len length of the subsequence to hash + * @param off offset to the first byte of the subsequence to hash + * @param len length of the subsequence to hash * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @param the type of the input - * @throws NullPointerException if {@code result == null} + * @param the type of the input + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} */ public abstract void hash(@Nullable T input, Access access, @@ -416,12 +418,12 @@ public long[] hashBooleans(final boolean[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code boolean} in the subsequence to hash - * @param len length of the subsequence to hash + * @param input the array to read data from + * @param off index of the first {@code boolean} in the subsequence to hash + * @param len length of the subsequence to hash * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -476,12 +478,12 @@ public long[] hashBytes(final byte[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code byte} in the subsequence to hash - * @param len length of the subsequence to hash + * @param input the array to read data from + * @param off index of the first {@code byte} in the subsequence to hash + * @param len length of the subsequence to hash * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -539,12 +541,12 @@ public long[] hashBytes(final ByteBuffer input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the buffer to read bytes from - * @param off index of the first {@code byte} in the subsequence to hash - * @param len length of the subsequence to hash + * @param input the buffer to read bytes from + * @param off index of the first {@code byte} in the subsequence to hash + * @param len length of the subsequence to hash * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -580,10 +582,10 @@ public long[] hashBytes(final ByteBuffer input, final int off, final int len) { * {@code result.length > newResultArray().length]}. * * @param address the address of the first byte to hash - * @param len length of the byte sequence to hash - * @param result the container array for storing the hash results, - * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @param len length of the byte sequence to hash + * @param result the container array for storing the hash results, + * should be alloced by {@link #newResultArray} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -636,13 +638,13 @@ public long[] hashChars(final char[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code char} in the subsequence to hash - * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence - * to hash is {@code len * 2L}) + * @param input the array to read data from + * @param off index of the first {@code char} in the subsequence to hash + * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence + * to hash is {@code len * 2L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -698,13 +700,13 @@ public long[] hashChars(final String input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the string which bytes to hash - * @param off index of the first {@code char} in the subsequence to hash - * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence - * to hash is {@code len * 2L}) + * @param input the string which bytes to hash + * @param off index of the first {@code char} in the subsequence to hash + * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence + * to hash is {@code len * 2L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -759,13 +761,13 @@ public long[] hashChars(final T input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the char sequence which bytes to hash - * @param off index of the first {@code char} in the subsequence to hash - * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence - * to hash is {@code len * 2L}) + * @param input the char sequence which bytes to hash + * @param off index of the first {@code char} in the subsequence to hash + * @param len length of the subsequence to hash, in chars (i.e. the length of the bytes sequence + * to hash is {@code len * 2L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -821,13 +823,13 @@ public long[] hashShorts(final short[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code short} in the subsequence to hash - * @param len length of the subsequence to hash, in shorts (i.e. the length of the bytes - * sequence to hash is {@code len * 2L}) + * @param input the array to read data from + * @param off index of the first {@code short} in the subsequence to hash + * @param len length of the subsequence to hash, in shorts (i.e. the length of the bytes + * sequence to hash is {@code len * 2L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -882,13 +884,13 @@ public long[] hashInts(final int[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code int} in the subsequence to hash - * @param len length of the subsequence to hash, in ints (i.e. the length of the bytes sequence - * to hash is {@code len * 4L}) + * @param input the array to read data from + * @param off index of the first {@code int} in the subsequence to hash + * @param len length of the subsequence to hash, in ints (i.e. the length of the bytes sequence + * to hash is {@code len * 4L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} @@ -943,13 +945,13 @@ public long[] hashLongs(final long[] input) { * elements of the array will not be touched when * {@code result.length > newResultArray().length]}. * - * @param input the array to read data from - * @param off index of the first {@code long} in the subsequence to hash - * @param len length of the subsequence to hash, in longs (i.e. the length of the bytes sequence - * to hash is {@code len * 8L}) + * @param input the array to read data from + * @param off index of the first {@code long} in the subsequence to hash + * @param len length of the subsequence to hash, in longs (i.e. the length of the bytes sequence + * to hash is {@code len * 8L}) * @param result the container array for storing the hash results, * should be alloced by {@link #newResultArray} - * @throws NullPointerException if {@code result == null} + * @throws NullPointerException if {@code result == null} * @throws IllegalArgumentException if {@code result.length < newResultArray().length} * @throws IllegalArgumentException if {@code off < 0} or {@code off + len > input.length} * or {@code len < 0} diff --git a/src/main/java/net/openhft/hashing/ModernCompactStringHash.java b/src/main/java/net/openhft/hashing/ModernCompactStringHash.java index 54354ae..4a98fa0 100644 --- a/src/main/java/net/openhft/hashing/ModernCompactStringHash.java +++ b/src/main/java/net/openhft/hashing/ModernCompactStringHash.java @@ -3,10 +3,10 @@ */ package net.openhft.hashing; -import java.lang.reflect.Field; import javax.annotation.ParametersAreNonnullByDefault; -import static net.openhft.hashing.UnsafeAccess.*; -import static net.openhft.hashing.Util.*; +import java.lang.reflect.Field; + +import static net.openhft.hashing.Util.checkArrayOffs; @ParametersAreNonnullByDefault enum ModernCompactStringHash implements StringHash { @@ -15,7 +15,7 @@ enum ModernCompactStringHash implements StringHash { private static final long valueOffset; private static final boolean enableCompactStrings; private static final Access compactLatin1Access - = CompactLatin1CharSequenceAccess.INSTANCE; + = CompactLatin1CharSequenceAccess.INSTANCE; static { try { @@ -31,7 +31,7 @@ enum ModernCompactStringHash implements StringHash { @Override public long longHash(final String s, final LongHashFunction hashFunction, - final int off, final int len) { + final int off, final int len) { final int sl = s.length(); if (len <= 0 || sl <= 0) { checkArrayOffs(sl, off, len); // check as chars @@ -41,16 +41,16 @@ public long longHash(final String s, final LongHashFunction hashFunction, if (enableCompactStrings && sl == value.length) { checkArrayOffs(sl, off, len); // check as chars // 'off' and 'len' are passed as bytes - return hashFunction.hash(value, compactLatin1Access, (long)off*2L, (long)len*2L); + return hashFunction.hash(value, compactLatin1Access, (long) off * 2L, (long) len * 2L); } else { - return hashFunction.hashBytes(value, off*2, len*2); // hash as bytes + return hashFunction.hashBytes(value, off * 2, len * 2); // hash as bytes } } } @Override public void hash(final String s, final LongTupleHashFunction hashFunction, - final int off, final int len, final long[] result) { + final int off, final int len, final long[] result) { final int sl = s.length(); if (len <= 0 || sl <= 0) { checkArrayOffs(sl, off, len); // check as chars @@ -60,9 +60,9 @@ public void hash(final String s, final LongTupleHashFunction hashFunction, if (enableCompactStrings && sl == value.length) { checkArrayOffs(sl, off, len); // check as chars // 'off' and 'len' are passed as bytes - hashFunction.hash(value, compactLatin1Access, (long)off*2L, (long)len*2L, result); + hashFunction.hash(value, compactLatin1Access, (long) off * 2L, (long) len * 2L, result); } else { - hashFunction.hashBytes(value, off*2, len*2, result); // hash as bytes + hashFunction.hashBytes(value, off * 2, len * 2, result); // hash as bytes } } } diff --git a/src/main/java/net/openhft/hashing/ModernHotSpotStringHash.java b/src/main/java/net/openhft/hashing/ModernHotSpotStringHash.java index e3ca9ec..affa0d0 100644 --- a/src/main/java/net/openhft/hashing/ModernHotSpotStringHash.java +++ b/src/main/java/net/openhft/hashing/ModernHotSpotStringHash.java @@ -3,8 +3,8 @@ */ package net.openhft.hashing; -import java.lang.reflect.Field; import javax.annotation.ParametersAreNonnullByDefault; +import java.lang.reflect.Field; @ParametersAreNonnullByDefault enum ModernHotSpotStringHash implements StringHash { @@ -29,7 +29,7 @@ public long longHash(String s, LongHashFunction hashFunction, int off, int len) @Override public void hash(final String s, final LongTupleHashFunction hashFunction, - final int off, final int len, final long[] result) { + final int off, final int len, final long[] result) { final char[] value = (char[]) UnsafeAccess.UNSAFE.getObject(s, valueOffset); hashFunction.hashChars(value, off, len, result); } diff --git a/src/main/java/net/openhft/hashing/MurmurHash_3.java b/src/main/java/net/openhft/hashing/MurmurHash_3.java index a6c520f..8c63141 100644 --- a/src/main/java/net/openhft/hashing/MurmurHash_3.java +++ b/src/main/java/net/openhft/hashing/MurmurHash_3.java @@ -5,6 +5,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; + import javax.annotation.ParametersAreNonnullByDefault; import static java.nio.ByteOrder.LITTLE_ENDIAN; @@ -217,6 +218,7 @@ private Object readResolve() { public int bitsLength() { return 128; } + @Override @NotNull public long[] newResultArray() { @@ -278,6 +280,7 @@ public long dualHash(@Nullable T input, Access access, long off, long len static LongTupleHashFunction asLongTupleHashFunctionWithoutSeed() { return AsLongTupleHashFunction.SEEDLESS_INSTANCE; } + @NotNull static LongHashFunction asLongHashFunctionWithoutSeed() { return AsLongTupleHashFunction.SEEDLESS_INSTANCE_LONG; @@ -322,6 +325,7 @@ public long dualHashVoid(@Nullable long[] result) { static LongTupleHashFunction asLongTupleHashFunctionWithSeed(long seed) { return new AsLongTupleHashFunctionSeeded(seed); } + @NotNull static LongHashFunction asLongHashFunctionWithSeed(long seed) { return new AsLongTupleHashFunctionSeeded(seed).asLongHashFunction(); diff --git a/src/main/java/net/openhft/hashing/Primitives.java b/src/main/java/net/openhft/hashing/Primitives.java index ec9049c..ff77095 100644 --- a/src/main/java/net/openhft/hashing/Primitives.java +++ b/src/main/java/net/openhft/hashing/Primitives.java @@ -8,7 +8,8 @@ final class Primitives { - private Primitives() {} + private Primitives() { + } static final boolean NATIVE_LITTLE_ENDIAN = nativeOrder() == LITTLE_ENDIAN; @@ -42,11 +43,11 @@ private static class ByteOrderHelper { int adjustByteOrder(final int v) { return v; } short adjustByteOrder(final short v) { return v; } char adjustByteOrder(final char v) { return v; } - } + } private static class ByteOrderHelperReverse extends ByteOrderHelper { - @Override long adjustByteOrder(final long v) { return Long.reverseBytes(v); } - @Override int adjustByteOrder(final int v) { return Integer.reverseBytes(v); } - @Override short adjustByteOrder(final short v) { return Short.reverseBytes(v); } - @Override char adjustByteOrder(final char v) { return Character.reverseBytes(v); } + long adjustByteOrder(final long v) { return Long.reverseBytes(v); } + int adjustByteOrder(final int v) { return Integer.reverseBytes(v); } + short adjustByteOrder(final short v) { return Short.reverseBytes(v); } + char adjustByteOrder(final char v) { return Character.reverseBytes(v); } } } diff --git a/src/main/java/net/openhft/hashing/StringHash.java b/src/main/java/net/openhft/hashing/StringHash.java index 4935426..4ce196d 100644 --- a/src/main/java/net/openhft/hashing/StringHash.java +++ b/src/main/java/net/openhft/hashing/StringHash.java @@ -8,5 +8,6 @@ @ParametersAreNonnullByDefault interface StringHash { long longHash(String s, LongHashFunction hashFunction, int off, int len); + void hash(String s, LongTupleHashFunction hashFunction, int off, int len, long[] result); } diff --git a/src/main/java/net/openhft/hashing/UnknownJvmStringHash.java b/src/main/java/net/openhft/hashing/UnknownJvmStringHash.java index 4f0dd41..e305751 100644 --- a/src/main/java/net/openhft/hashing/UnknownJvmStringHash.java +++ b/src/main/java/net/openhft/hashing/UnknownJvmStringHash.java @@ -16,7 +16,7 @@ public long longHash(String s, LongHashFunction hashFunction, int off, int len) @Override public void hash(final String s, final LongTupleHashFunction hashFunction, - final int off, final int len, final long[] result) { + final int off, final int len, final long[] result) { LongTupleHashFunction.hashNativeChars(hashFunction, s, off, len, result); } } diff --git a/src/main/java/net/openhft/hashing/UnsafeAccess.java b/src/main/java/net/openhft/hashing/UnsafeAccess.java index 6dfbcac..d8f8c9a 100644 --- a/src/main/java/net/openhft/hashing/UnsafeAccess.java +++ b/src/main/java/net/openhft/hashing/UnsafeAccess.java @@ -3,9 +3,10 @@ */ package net.openhft.hashing; +import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.nio.ByteOrder; -import sun.misc.Unsafe; import static net.openhft.hashing.Primitives.*; @@ -15,8 +16,8 @@ public class UnsafeAccess extends Access { // for test only static final UnsafeAccess OLD_INSTANCE = NATIVE_LITTLE_ENDIAN - ? new OldUnsafeAccessLittleEndian() - : new OldUnsafeAccessBigEndian(); + ? new OldUnsafeAccessLittleEndian() + : new OldUnsafeAccessBigEndian(); static final Unsafe UNSAFE; @@ -43,10 +44,10 @@ public class UnsafeAccess extends Access { INT_BASE = UNSAFE.arrayBaseOffset(int[].class); LONG_BASE = UNSAFE.arrayBaseOffset(long[].class); - TRUE_BYTE_VALUE = (byte)UNSAFE.getInt(new boolean[] {true, true, true, true}, - BOOLEAN_BASE); - FALSE_BYTE_VALUE = (byte)UNSAFE.getInt(new boolean[] {false, false, false, false}, - BOOLEAN_BASE); + TRUE_BYTE_VALUE = (byte) UNSAFE.getInt(new boolean[]{true, true, true, true}, + BOOLEAN_BASE); + FALSE_BYTE_VALUE = (byte) UNSAFE.getInt(new boolean[]{false, false, false, false}, + BOOLEAN_BASE); } catch (final Exception e) { throw new AssertionError(e); } @@ -63,7 +64,8 @@ public class UnsafeAccess extends Access { INSTANCE_NON_NATIVE = Access.newDefaultReverseAccess(INSTANCE); } - private UnsafeAccess() {} + private UnsafeAccess() { + } @Override public long getLong(Object input, long offset) { @@ -125,12 +127,12 @@ public int getByte(final Object input, final long offset) { private static class OldUnsafeAccessBigEndian extends UnsafeAccess { @Override public int getShort(final Object input, final long offset) { - return (int)(short)UNSAFE.getInt(input, offset - 2); + return (int) (short) UNSAFE.getInt(input, offset - 2); } @Override public int getByte(final Object input, final long offset) { - return (int)(byte)UNSAFE.getInt(input, offset - 3); + return (int) (byte) UNSAFE.getInt(input, offset - 3); } } } diff --git a/src/main/java/net/openhft/hashing/Util.java b/src/main/java/net/openhft/hashing/Util.java index f3a4b95..48669eb 100644 --- a/src/main/java/net/openhft/hashing/Util.java +++ b/src/main/java/net/openhft/hashing/Util.java @@ -3,12 +3,10 @@ */ package net.openhft.hashing; -import java.nio.ByteBuffer; -import sun.nio.ch.DirectBuffer; - import org.jetbrains.annotations.NotNull; +import sun.nio.ch.DirectBuffer; -import static java.nio.ByteOrder.*; +import java.nio.ByteBuffer; final class Util { @@ -25,6 +23,7 @@ final class Util { static private boolean isHotSpotVM(@NotNull final String name) { return name.contains("HotSpot") || name.contains("OpenJDK"); } + static private boolean isJ9VM(@NotNull final String name) { return name.contains("Eclipse OpenJ9") || name.contains("IBM J9"); } @@ -35,7 +34,8 @@ static private boolean isZing(@NotNull final String name) { @NotNull static final StringHash VALID_STRING_HASH; - static { + + static { StringHash stringHash = null; try { final String vmName = System.getProperty("java.vm.name"); @@ -73,6 +73,6 @@ static void checkArrayOffs(final int arrayLength, final int off, final int len) } static long getDirectBufferAddress(@NotNull final ByteBuffer buff) { - return ((DirectBuffer)buff).address(); + return ((DirectBuffer) buff).address(); } } diff --git a/src/main/java/net/openhft/hashing/WyHash.java b/src/main/java/net/openhft/hashing/WyHash.java index acdeb24..db17633 100644 --- a/src/main/java/net/openhft/hashing/WyHash.java +++ b/src/main/java/net/openhft/hashing/WyHash.java @@ -27,8 +27,8 @@ private static long _wymum(final long lhs, final long rhs) { private static long _wyr3(final Access access, T in, final long index, long k) { return ((long) access.u8(in, index) << 16) | - ((long) access.u8(in, index + (k >>> 1)) << 8) | - ((long) access.u8(in, index + k - 1)); + ((long) access.u8(in, index + (k >>> 1)) << 8) | + ((long) access.u8(in, index + k - 1)); } private static long u64Rorate32(final Access access, T in, final long index) { @@ -37,96 +37,96 @@ private static long u64Rorate32(final Access access, T in, final long ind /** * - * @param seed seed for the hash - * @param input the type wrapped by the Access, ex. byte[], ByteBuffer, etc. + * @param seed seed for the hash + * @param input the type wrapped by the Access, ex. byte[], ByteBuffer, etc. * @param access class wrapping optimized access pattern to the input - * @param off offset to the input + * @param off offset to the input * @param length length to read from input - * @param byte[], ByteBuffer, etc. + * @param byte[], ByteBuffer, etc. * @return hash result */ static long wyHash64(long seed, T input, Access access, long off, long length) { - if(length <= 0) + if (length <= 0) return 0; - else if(length<4) - return _wymum(_wymum(_wyr3(access, input,off,length)^seed^_wyp0, - seed^_wyp1)^seed,length^_wyp4); - else if(length<=8) + else if (length < 4) + return _wymum(_wymum(_wyr3(access, input, off, length) ^ seed ^ _wyp0, + seed ^ _wyp1) ^ seed, length ^ _wyp4); + else if (length <= 8) return _wymum(_wymum(access.u32(input, off) ^ seed ^ _wyp0, - access.u32(input, off + length - 4) ^ seed ^ _wyp1) - ^ seed, length ^ _wyp4); - else if(length<=16) - return _wymum(_wymum(u64Rorate32(access, input,off)^seed^_wyp0, - u64Rorate32(access, input,off+length-8)^seed^_wyp1) - ^seed,length^_wyp4); - else if(length<=24) - return _wymum(_wymum(u64Rorate32(access, input,off)^seed^_wyp0, - u64Rorate32(access, input,off+8)^seed^_wyp1)^ - _wymum(u64Rorate32(access, input,off+length-8) - ^seed^_wyp2,seed^_wyp3),length^_wyp4); - else if(length<=32) - return _wymum(_wymum(u64Rorate32(access, input,off)^seed^_wyp0, - u64Rorate32(access, input,off+8)^seed^_wyp1) - ^_wymum(u64Rorate32(access, input,off+16)^seed^_wyp2, - u64Rorate32(access, input,off+length-8)^seed^_wyp3),length^_wyp4); - long see1=seed; long i=length, p=off; - for(;i>256;i-=256,p+=256){ + access.u32(input, off + length - 4) ^ seed ^ _wyp1) + ^ seed, length ^ _wyp4); + else if (length <= 16) + return _wymum(_wymum(u64Rorate32(access, input, off) ^ seed ^ _wyp0, + u64Rorate32(access, input, off + length - 8) ^ seed ^ _wyp1) + ^ seed, length ^ _wyp4); + else if (length <= 24) + return _wymum(_wymum(u64Rorate32(access, input, off) ^ seed ^ _wyp0, + u64Rorate32(access, input, off + 8) ^ seed ^ _wyp1) ^ + _wymum(u64Rorate32(access, input, off + length - 8) + ^ seed ^ _wyp2, seed ^ _wyp3), length ^ _wyp4); + else if (length <= 32) + return _wymum(_wymum(u64Rorate32(access, input, off) ^ seed ^ _wyp0, + u64Rorate32(access, input, off + 8) ^ seed ^ _wyp1) + ^ _wymum(u64Rorate32(access, input, off + 16) ^ seed ^ _wyp2, + u64Rorate32(access, input, off + length - 8) ^ seed ^ _wyp3), length ^ _wyp4); + long see1 = seed, i = length, p = off; + for (; i > 256; i -= 256, p += 256) { seed = _wymum(access.i64(input, p) ^ seed ^ _wyp0, - access.i64(input, p + 8) ^ seed ^ _wyp1) ^ - _wymum(access.i64(input, p + 16) ^ seed ^ _wyp2, - access.i64(input, p + 24) ^ seed ^ _wyp3); + access.i64(input, p + 8) ^ seed ^ _wyp1) ^ + _wymum(access.i64(input, p + 16) ^ seed ^ _wyp2, + access.i64(input, p + 24) ^ seed ^ _wyp3); see1 = _wymum(access.i64(input, p + 32) ^ see1 ^ _wyp1, - access.i64(input, p + 40) ^ see1 ^ _wyp2) ^ - _wymum(access.i64(input, p + 48) ^ see1 ^ _wyp3, - access.i64(input, p + 56) ^ see1 ^ _wyp0); + access.i64(input, p + 40) ^ see1 ^ _wyp2) ^ + _wymum(access.i64(input, p + 48) ^ see1 ^ _wyp3, + access.i64(input, p + 56) ^ see1 ^ _wyp0); seed = _wymum(access.i64(input, p + 64) ^ seed ^ _wyp0, - access.i64(input, p + 72) ^ seed ^ _wyp1) ^ - _wymum(access.i64(input, p + 80) ^ seed ^ _wyp2, - access.i64(input, p + 88) ^ seed ^ _wyp3); + access.i64(input, p + 72) ^ seed ^ _wyp1) ^ + _wymum(access.i64(input, p + 80) ^ seed ^ _wyp2, + access.i64(input, p + 88) ^ seed ^ _wyp3); see1 = _wymum(access.i64(input, p + 96) ^ see1 ^ _wyp1, - access.i64(input, p + 104) ^ see1 ^ _wyp2) ^ - _wymum(access.i64(input, p + 112) ^ see1 ^ _wyp3, - access.i64(input, p + 120) ^ see1 ^ _wyp0); + access.i64(input, p + 104) ^ see1 ^ _wyp2) ^ + _wymum(access.i64(input, p + 112) ^ see1 ^ _wyp3, + access.i64(input, p + 120) ^ see1 ^ _wyp0); seed = _wymum(access.i64(input, p + 128) ^ seed ^ _wyp0, - access.i64(input, p + 136) ^ seed ^ _wyp1) ^ - _wymum(access.i64(input, p + 144) ^ seed ^ _wyp2, - access.i64(input, p + 152) ^ seed ^ _wyp3); + access.i64(input, p + 136) ^ seed ^ _wyp1) ^ + _wymum(access.i64(input, p + 144) ^ seed ^ _wyp2, + access.i64(input, p + 152) ^ seed ^ _wyp3); see1 = _wymum(access.i64(input, p + 160) ^ see1 ^ _wyp1, - access.i64(input, p + 168) ^ see1 ^ _wyp2) ^ - _wymum(access.i64(input, p + 176) ^ see1 ^ _wyp3, - access.i64(input, p + 184) ^ see1 ^ _wyp0); + access.i64(input, p + 168) ^ see1 ^ _wyp2) ^ + _wymum(access.i64(input, p + 176) ^ see1 ^ _wyp3, + access.i64(input, p + 184) ^ see1 ^ _wyp0); seed = _wymum(access.i64(input, p + 192) ^ seed ^ _wyp0, - access.i64(input, p + 200) ^ seed ^ _wyp1) ^ - _wymum(access.i64(input, p + 208) ^ seed ^ _wyp2, - access.i64(input, p + 216) ^ seed ^ _wyp3); + access.i64(input, p + 200) ^ seed ^ _wyp1) ^ + _wymum(access.i64(input, p + 208) ^ seed ^ _wyp2, + access.i64(input, p + 216) ^ seed ^ _wyp3); see1 = _wymum(access.i64(input, p + 224) ^ see1 ^ _wyp1, - access.i64(input, p + 232) ^ see1 ^ _wyp2) ^ - _wymum(access.i64(input, p + 240) ^ see1 ^ _wyp3, - access.i64(input, p + 248) ^ see1 ^ _wyp0); + access.i64(input, p + 232) ^ see1 ^ _wyp2) ^ + _wymum(access.i64(input, p + 240) ^ see1 ^ _wyp3, + access.i64(input, p + 248) ^ see1 ^ _wyp0); } for (; i > 32; i -= 32, p += 32) { seed = _wymum(access.i64(input, p) ^ seed ^ _wyp0, - access.i64(input, p + 8) ^ seed ^ _wyp1); + access.i64(input, p + 8) ^ seed ^ _wyp1); see1 = _wymum(access.i64(input, p + 16) ^ see1 ^ _wyp2, - access.i64(input, p + 24) ^ see1 ^ _wyp3); + access.i64(input, p + 24) ^ see1 ^ _wyp3); } if (i < 4) { seed = _wymum(_wyr3(access, input, p, i) ^ seed ^ _wyp0, seed ^ _wyp1); } else if (i <= 8) { seed = _wymum(access.u32(input, p) ^ seed ^ _wyp0, - access.u32(input, p + i - 4) ^ seed ^ _wyp1); + access.u32(input, p + i - 4) ^ seed ^ _wyp1); } else if (i <= 16) { seed = _wymum(u64Rorate32(access, input, p) ^ seed ^ _wyp0, - u64Rorate32(access, input, p + i - 8) ^ seed ^ _wyp1); + u64Rorate32(access, input, p + i - 8) ^ seed ^ _wyp1); } else if (i <= 24) { seed = _wymum(u64Rorate32(access, input, p) ^ seed ^ _wyp0, - u64Rorate32(access, input, p + 8) ^ seed ^ _wyp1); + u64Rorate32(access, input, p + 8) ^ seed ^ _wyp1); see1 = _wymum(u64Rorate32(access, input, p + i - 8) ^ see1 ^ _wyp2, see1 ^ _wyp3); } else { seed = _wymum(u64Rorate32(access, input, p) ^ seed ^ _wyp0, - u64Rorate32(access, input, p + 8) ^ seed ^ _wyp1); + u64Rorate32(access, input, p + 8) ^ seed ^ _wyp1); see1 = _wymum(u64Rorate32(access, input, p + 16) ^ see1 ^ _wyp2, - u64Rorate32(access, input, p + i - 8) ^ see1 ^ _wyp3); + u64Rorate32(access, input, p + i - 8) ^ see1 ^ _wyp3); } return _wymum(seed ^ see1, length ^ _wyp4); } @@ -153,8 +153,8 @@ public long hashLong(long input) { long hi = input & 0xFFFFFFFFL; long lo = (input >>> 32) & 0xFFFFFFFFL; return _wymum(_wymum(hi ^ seed() ^ _wyp0, - lo ^ seed() ^ _wyp1) - ^ seed(), 8 ^ _wyp4); + lo ^ seed() ^ _wyp1) + ^ seed(), 8 ^ _wyp4); } @Override @@ -162,8 +162,8 @@ public long hashInt(int input) { input = Primitives.nativeToLittleEndian(input); long longInput = (input & 0xFFFFFFFFL); return _wymum(_wymum(longInput ^ seed() ^ _wyp0, - longInput ^ seed() ^ _wyp1) - ^ seed(), 4 ^ _wyp4); + longInput ^ seed() ^ _wyp1) + ^ seed(), 4 ^ _wyp4); } @Override @@ -172,12 +172,12 @@ public long hashShort(short input) { long hi = (input >>> 8) & 0xFFL; long wyr3 = hi | hi << 8 | (input & 0xFFL) << 16; return _wymum(_wymum(wyr3 ^ seed() ^ _wyp0, - seed() ^ _wyp1) ^ seed(), 2 ^ _wyp4); + seed() ^ _wyp1) ^ seed(), 2 ^ _wyp4); } @Override public long hashChar(final char input) { - return hashShort((short)input); + return hashShort((short) input); } @Override @@ -185,7 +185,7 @@ public long hashByte(final byte input) { long hi = input & 0xFFL; long wyr3 = hi | hi << 8 | hi << 16; return _wymum(_wymum(wyr3 ^ seed() ^ _wyp0, - seed() ^ _wyp1) ^ seed(), 1 ^ _wyp4); + seed() ^ _wyp1) ^ seed(), 1 ^ _wyp4); } @Override diff --git a/src/main/java/net/openhft/hashing/XXH3.java b/src/main/java/net/openhft/hashing/XXH3.java index 4ff62a3..da616c9 100644 --- a/src/main/java/net/openhft/hashing/XXH3.java +++ b/src/main/java/net/openhft/hashing/XXH3.java @@ -7,7 +7,7 @@ import static java.nio.ByteOrder.LITTLE_ENDIAN; import static net.openhft.hashing.Maths.unsignedLongMulXorFold; -import static net.openhft.hashing.UnsafeAccess.*; +import static net.openhft.hashing.UnsafeAccess.BYTE_BASE; /** * Adapted version of XXH3 implementation from https://github.com/Cyan4973/xxHash. @@ -18,18 +18,18 @@ class XXH3 { /*! Pseudorandom secret taken directly from FARSH. */ private static final byte[] XXH3_kSecret = { - (byte)0xb8, (byte)0xfe, (byte)0x6c, (byte)0x39, (byte)0x23, (byte)0xa4, (byte)0x4b, (byte)0xbe, (byte)0x7c, (byte)0x01, (byte)0x81, (byte)0x2c, (byte)0xf7, (byte)0x21, (byte)0xad, (byte)0x1c, - (byte)0xde, (byte)0xd4, (byte)0x6d, (byte)0xe9, (byte)0x83, (byte)0x90, (byte)0x97, (byte)0xdb, (byte)0x72, (byte)0x40, (byte)0xa4, (byte)0xa4, (byte)0xb7, (byte)0xb3, (byte)0x67, (byte)0x1f, - (byte)0xcb, (byte)0x79, (byte)0xe6, (byte)0x4e, (byte)0xcc, (byte)0xc0, (byte)0xe5, (byte)0x78, (byte)0x82, (byte)0x5a, (byte)0xd0, (byte)0x7d, (byte)0xcc, (byte)0xff, (byte)0x72, (byte)0x21, - (byte)0xb8, (byte)0x08, (byte)0x46, (byte)0x74, (byte)0xf7, (byte)0x43, (byte)0x24, (byte)0x8e, (byte)0xe0, (byte)0x35, (byte)0x90, (byte)0xe6, (byte)0x81, (byte)0x3a, (byte)0x26, (byte)0x4c, - (byte)0x3c, (byte)0x28, (byte)0x52, (byte)0xbb, (byte)0x91, (byte)0xc3, (byte)0x00, (byte)0xcb, (byte)0x88, (byte)0xd0, (byte)0x65, (byte)0x8b, (byte)0x1b, (byte)0x53, (byte)0x2e, (byte)0xa3, - (byte)0x71, (byte)0x64, (byte)0x48, (byte)0x97, (byte)0xa2, (byte)0x0d, (byte)0xf9, (byte)0x4e, (byte)0x38, (byte)0x19, (byte)0xef, (byte)0x46, (byte)0xa9, (byte)0xde, (byte)0xac, (byte)0xd8, - (byte)0xa8, (byte)0xfa, (byte)0x76, (byte)0x3f, (byte)0xe3, (byte)0x9c, (byte)0x34, (byte)0x3f, (byte)0xf9, (byte)0xdc, (byte)0xbb, (byte)0xc7, (byte)0xc7, (byte)0x0b, (byte)0x4f, (byte)0x1d, - (byte)0x8a, (byte)0x51, (byte)0xe0, (byte)0x4b, (byte)0xcd, (byte)0xb4, (byte)0x59, (byte)0x31, (byte)0xc8, (byte)0x9f, (byte)0x7e, (byte)0xc9, (byte)0xd9, (byte)0x78, (byte)0x73, (byte)0x64, - (byte)0xea, (byte)0xc5, (byte)0xac, (byte)0x83, (byte)0x34, (byte)0xd3, (byte)0xeb, (byte)0xc3, (byte)0xc5, (byte)0x81, (byte)0xa0, (byte)0xff, (byte)0xfa, (byte)0x13, (byte)0x63, (byte)0xeb, - (byte)0x17, (byte)0x0d, (byte)0xdd, (byte)0x51, (byte)0xb7, (byte)0xf0, (byte)0xda, (byte)0x49, (byte)0xd3, (byte)0x16, (byte)0x55, (byte)0x26, (byte)0x29, (byte)0xd4, (byte)0x68, (byte)0x9e, - (byte)0x2b, (byte)0x16, (byte)0xbe, (byte)0x58, (byte)0x7d, (byte)0x47, (byte)0xa1, (byte)0xfc, (byte)0x8f, (byte)0xf8, (byte)0xb8, (byte)0xd1, (byte)0x7a, (byte)0xd0, (byte)0x31, (byte)0xce, - (byte)0x45, (byte)0xcb, (byte)0x3a, (byte)0x8f, (byte)0x95, (byte)0x16, (byte)0x04, (byte)0x28, (byte)0xaf, (byte)0xd7, (byte)0xfb, (byte)0xca, (byte)0xbb, (byte)0x4b, (byte)0x40, (byte)0x7e, + (byte) 0xb8, (byte) 0xfe, (byte) 0x6c, (byte) 0x39, (byte) 0x23, (byte) 0xa4, (byte) 0x4b, (byte) 0xbe, (byte) 0x7c, (byte) 0x01, (byte) 0x81, (byte) 0x2c, (byte) 0xf7, (byte) 0x21, (byte) 0xad, (byte) 0x1c, + (byte) 0xde, (byte) 0xd4, (byte) 0x6d, (byte) 0xe9, (byte) 0x83, (byte) 0x90, (byte) 0x97, (byte) 0xdb, (byte) 0x72, (byte) 0x40, (byte) 0xa4, (byte) 0xa4, (byte) 0xb7, (byte) 0xb3, (byte) 0x67, (byte) 0x1f, + (byte) 0xcb, (byte) 0x79, (byte) 0xe6, (byte) 0x4e, (byte) 0xcc, (byte) 0xc0, (byte) 0xe5, (byte) 0x78, (byte) 0x82, (byte) 0x5a, (byte) 0xd0, (byte) 0x7d, (byte) 0xcc, (byte) 0xff, (byte) 0x72, (byte) 0x21, + (byte) 0xb8, (byte) 0x08, (byte) 0x46, (byte) 0x74, (byte) 0xf7, (byte) 0x43, (byte) 0x24, (byte) 0x8e, (byte) 0xe0, (byte) 0x35, (byte) 0x90, (byte) 0xe6, (byte) 0x81, (byte) 0x3a, (byte) 0x26, (byte) 0x4c, + (byte) 0x3c, (byte) 0x28, (byte) 0x52, (byte) 0xbb, (byte) 0x91, (byte) 0xc3, (byte) 0x00, (byte) 0xcb, (byte) 0x88, (byte) 0xd0, (byte) 0x65, (byte) 0x8b, (byte) 0x1b, (byte) 0x53, (byte) 0x2e, (byte) 0xa3, + (byte) 0x71, (byte) 0x64, (byte) 0x48, (byte) 0x97, (byte) 0xa2, (byte) 0x0d, (byte) 0xf9, (byte) 0x4e, (byte) 0x38, (byte) 0x19, (byte) 0xef, (byte) 0x46, (byte) 0xa9, (byte) 0xde, (byte) 0xac, (byte) 0xd8, + (byte) 0xa8, (byte) 0xfa, (byte) 0x76, (byte) 0x3f, (byte) 0xe3, (byte) 0x9c, (byte) 0x34, (byte) 0x3f, (byte) 0xf9, (byte) 0xdc, (byte) 0xbb, (byte) 0xc7, (byte) 0xc7, (byte) 0x0b, (byte) 0x4f, (byte) 0x1d, + (byte) 0x8a, (byte) 0x51, (byte) 0xe0, (byte) 0x4b, (byte) 0xcd, (byte) 0xb4, (byte) 0x59, (byte) 0x31, (byte) 0xc8, (byte) 0x9f, (byte) 0x7e, (byte) 0xc9, (byte) 0xd9, (byte) 0x78, (byte) 0x73, (byte) 0x64, + (byte) 0xea, (byte) 0xc5, (byte) 0xac, (byte) 0x83, (byte) 0x34, (byte) 0xd3, (byte) 0xeb, (byte) 0xc3, (byte) 0xc5, (byte) 0x81, (byte) 0xa0, (byte) 0xff, (byte) 0xfa, (byte) 0x13, (byte) 0x63, (byte) 0xeb, + (byte) 0x17, (byte) 0x0d, (byte) 0xdd, (byte) 0x51, (byte) 0xb7, (byte) 0xf0, (byte) 0xda, (byte) 0x49, (byte) 0xd3, (byte) 0x16, (byte) 0x55, (byte) 0x26, (byte) 0x29, (byte) 0xd4, (byte) 0x68, (byte) 0x9e, + (byte) 0x2b, (byte) 0x16, (byte) 0xbe, (byte) 0x58, (byte) 0x7d, (byte) 0x47, (byte) 0xa1, (byte) 0xfc, (byte) 0x8f, (byte) 0xf8, (byte) 0xb8, (byte) 0xd1, (byte) 0x7a, (byte) 0xd0, (byte) 0x31, (byte) 0xce, + (byte) 0x45, (byte) 0xcb, (byte) 0x3a, (byte) 0x8f, (byte) 0x95, (byte) 0x16, (byte) 0x04, (byte) 0x28, (byte) 0xaf, (byte) 0xd7, (byte) 0xfb, (byte) 0xca, (byte) 0xbb, (byte) 0x4b, (byte) 0x40, (byte) 0x7e, }; // Primes @@ -54,11 +54,13 @@ private static long XXH64_avalanche(long h64) { h64 *= XXH_PRIME64_3; return h64 ^ (h64 >>> 32); } + private static long XXH3_avalanche(long h64) { h64 ^= h64 >>> 37; h64 *= 0x165667919E3779F9L; return h64 ^ (h64 >>> 32); } + private static long XXH3_rrmxmx(long h64, final long length) { h64 ^= Long.rotateLeft(h64, 49) ^ Long.rotateLeft(h64, 24); h64 *= 0x9FB21C651E98DF25L; @@ -71,8 +73,8 @@ private static long XXH3_mix16B(final long seed, final T input, final Access final long input_lo = access.i64(input, offIn); final long input_hi = access.i64(input, offIn + 8); return unsignedLongMulXorFold( - input_lo ^ (unsafeLE.i64(XXH3_kSecret, offSec) + seed), - input_hi ^ (unsafeLE.i64(XXH3_kSecret, offSec+8) - seed) + input_lo ^ (unsafeLE.i64(XXH3_kSecret, offSec) + seed), + input_hi ^ (unsafeLE.i64(XXH3_kSecret, offSec + 8) - seed) ); } @@ -81,15 +83,15 @@ private static long XXH3_mix16B(final long seed, final T input, final Access */ private static long XXH128_mix32B_once(final long seed, final long offSec, long acc, final long input0, final long input1, final long input2, final long input3) { acc += unsignedLongMulXorFold( - input0 ^ (unsafeLE.i64(XXH3_kSecret, offSec ) + seed), - input1 ^ (unsafeLE.i64(XXH3_kSecret, offSec + 8) - seed)); + input0 ^ (unsafeLE.i64(XXH3_kSecret, offSec) + seed), + input1 ^ (unsafeLE.i64(XXH3_kSecret, offSec + 8) - seed)); return acc ^ (input2 + input3); } private static long XXH3_mix2Accs(final long acc_lh, final long acc_rh, final byte[] secret, final long offSec) { return unsignedLongMulXorFold( - acc_lh ^ unsafeLE.i64(secret, offSec), - acc_rh ^ unsafeLE.i64(secret, offSec+8) ); + acc_lh ^ unsafeLE.i64(secret, offSec), + acc_rh ^ unsafeLE.i64(secret, offSec + 8)); } private static long XXH3_64bits_internal(final long seed, final byte[] secret, final T input, final Access access, final long off, final long length) { @@ -97,8 +99,8 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre // XXH3_len_0to16_64b if (length > 8) { // XXH3_len_9to16_64b - final long bitflip1 = (unsafeLE.i64(XXH3_kSecret, 24+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 32+BYTE_BASE)) + seed; - final long bitflip2 = (unsafeLE.i64(XXH3_kSecret, 40+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 48+BYTE_BASE)) - seed; + final long bitflip1 = (unsafeLE.i64(XXH3_kSecret, 24 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 32 + BYTE_BASE)) + seed; + final long bitflip2 = (unsafeLE.i64(XXH3_kSecret, 40 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 48 + BYTE_BASE)) - seed; final long input_lo = access.i64(input, off) ^ bitflip1; final long input_hi = access.i64(input, off + length - 8) ^ bitflip2; final long acc = length + Long.reverseBytes(input_lo) + input_hi + unsignedLongMulXorFold(input_lo, input_hi); @@ -107,9 +109,9 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre if (length >= 4) { // XXH3_len_4to8_64b long s = seed ^ Long.reverseBytes(seed & 0xFFFFFFFFL); - final long input1 = (long)access.i32(input, off); // high int will be shifted + final long input1 = (long) access.i32(input, off); // high int will be shifted final long input2 = access.u32(input, off + length - 4); - final long bitflip = (unsafeLE.i64(XXH3_kSecret, 8+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 16+BYTE_BASE)) - s; + final long bitflip = (unsafeLE.i64(XXH3_kSecret, 8 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 16 + BYTE_BASE)) - s; final long keyed = (input2 + (input1 << 32)) ^ bitflip; return XXH3_rrmxmx(keyed, length); } @@ -118,11 +120,11 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre final int c1 = access.u8(input, off + 0); final int c2 = access.i8(input, off + (length >> 1)); // high 3 bytes will be shifted final int c3 = access.u8(input, off + length - 1); - final long combined = Primitives.unsignedInt((c1 << 16) | (c2 << 24) | c3 | ((int)length << 8)); - final long bitflip = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, 4+BYTE_BASE)) + seed; + final long combined = Primitives.unsignedInt((c1 << 16) | (c2 << 24) | c3 | ((int) length << 8)); + final long bitflip = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, 4 + BYTE_BASE)) + seed; return XXH64_avalanche(combined ^ bitflip); } - return XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, 56+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 64+BYTE_BASE)); + return XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, 56 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 64 + BYTE_BASE)); } if (length <= 128) { // XXH3_len_17to128_64b @@ -148,15 +150,15 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre if (length <= 240) { // XXH3_len_129to240_64b long acc = length * XXH_PRIME64_1; - final int nbRounds = (int)length / 16; + final int nbRounds = (int) length / 16; int i = 0; for (; i < 8; ++i) { - acc += XXH3_mix16B(seed, input, access, off + 16*i, BYTE_BASE + 16*i); + acc += XXH3_mix16B(seed, input, access, off + 16 * i, BYTE_BASE + 16 * i); } acc = XXH3_avalanche(acc); for (; i < nbRounds; ++i) { - acc += XXH3_mix16B(seed, input, access, off + 16*i, BYTE_BASE + 16*(i-8) + 3); + acc += XXH3_mix16B(seed, input, access, off + 16 * i, BYTE_BASE + 16 * (i - 8) + 3); } /* last bytes */ @@ -179,42 +181,42 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre for (long n = 0; n < nb_blocks; n++) { // XXH3_accumulate final long offBlock = off + n * block_len; - for (long s = 0; s < nbStripesPerBlock; s++ ) { + for (long s = 0; s < nbStripesPerBlock; s++) { // XXH3_accumulate_512 final long offStripe = offBlock + s * 64; final long offSec = s * 8; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -223,14 +225,14 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre // XXH3_scrambleAcc_scalar final long offSec = BYTE_BASE + 192 - 64; - acc_0 = (acc_0 ^ (acc_0 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*0)) * XXH_PRIME32_1; - acc_1 = (acc_1 ^ (acc_1 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*1)) * XXH_PRIME32_1; - acc_2 = (acc_2 ^ (acc_2 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*2)) * XXH_PRIME32_1; - acc_3 = (acc_3 ^ (acc_3 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*3)) * XXH_PRIME32_1; - acc_4 = (acc_4 ^ (acc_4 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*4)) * XXH_PRIME32_1; - acc_5 = (acc_5 ^ (acc_5 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*5)) * XXH_PRIME32_1; - acc_6 = (acc_6 ^ (acc_6 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*6)) * XXH_PRIME32_1; - acc_7 = (acc_7 ^ (acc_7 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*7)) * XXH_PRIME32_1; + acc_0 = (acc_0 ^ (acc_0 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 0)) * XXH_PRIME32_1; + acc_1 = (acc_1 ^ (acc_1 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 1)) * XXH_PRIME32_1; + acc_2 = (acc_2 ^ (acc_2 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 2)) * XXH_PRIME32_1; + acc_3 = (acc_3 ^ (acc_3 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 3)) * XXH_PRIME32_1; + acc_4 = (acc_4 ^ (acc_4 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 4)) * XXH_PRIME32_1; + acc_5 = (acc_5 ^ (acc_5 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 5)) * XXH_PRIME32_1; + acc_6 = (acc_6 ^ (acc_6 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 6)) * XXH_PRIME32_1; + acc_7 = (acc_7 ^ (acc_7 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 7)) * XXH_PRIME32_1; } /* last partial block */ @@ -241,37 +243,37 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre final long offStripe = offBlock + s * 64; final long offSec = s * 8; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -283,37 +285,37 @@ private static long XXH3_64bits_internal(final long seed, final byte[] secre final long offStripe = off + length - 64; final long offSec = 192 - 64 - 7; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -334,15 +336,15 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr // XXH3_len_0to16_128b if (length > 8) { // XXH3_len_9to16_128b - final long bitflipl = (unsafeLE.i64(XXH3_kSecret, 32+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 40+BYTE_BASE)) - seed; - final long bitfliph = (unsafeLE.i64(XXH3_kSecret, 48+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 56+BYTE_BASE)) + seed; + final long bitflipl = (unsafeLE.i64(XXH3_kSecret, 32 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 40 + BYTE_BASE)) - seed; + final long bitfliph = (unsafeLE.i64(XXH3_kSecret, 48 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 56 + BYTE_BASE)) + seed; long input_hi = access.i64(input, off + length - 8); final long input_lo = access.i64(input, off) ^ input_hi ^ bitflipl; long m128_lo = input_lo * XXH_PRIME64_1; long m128_hi = Maths.unsignedLongMulHigh(input_lo, XXH_PRIME64_1); m128_lo += (length - 1) << 54; input_hi ^= bitfliph; - m128_hi += input_hi + Primitives.unsignedInt((int)input_hi) * (XXH_PRIME32_2 - 1); + m128_hi += input_hi + Primitives.unsignedInt((int) input_hi) * (XXH_PRIME32_2 - 1); m128_lo ^= Long.reverseBytes(m128_hi); final long low = XXH3_avalanche(m128_lo * XXH_PRIME64_2); @@ -356,9 +358,9 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr // XXH3_len_4to8_128b long s = seed ^ Long.reverseBytes(seed & 0xFFFFFFFFL); final long input_lo = access.u32(input, off); - final long input_hi = (long)access.i32(input, off + length - 4); // high int will be shifted + final long input_hi = (long) access.i32(input, off + length - 4); // high int will be shifted - final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24+BYTE_BASE)) + s; + final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24 + BYTE_BASE)) + s; final long keyed = (input_lo + (input_hi << 32)) ^ bitflip; final long pl = XXH_PRIME64_1 + (length << 2); /* Shift len to the left to ensure it is even, this avoids even multiplies. */ long m128_lo = keyed * pl; @@ -381,10 +383,10 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr final int c1 = access.u8(input, off + 0); final int c2 = access.i8(input, off + (length >> 1)); // high 3 bytes will be shifted final int c3 = access.u8(input, off + length - 1); - final int combinedl = (c1 << 16) | (c2 << 24) | c3 | ((int)length << 8); + final int combinedl = (c1 << 16) | (c2 << 24) | c3 | ((int) length << 8); final int combinedh = Integer.rotateLeft(Integer.reverseBytes(combinedl), 13); - final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+4)) + seed; - final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE+8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+12)) - seed; + final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 4)) + seed; + final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 12)) - seed; final long low = XXH64_avalanche(Primitives.unsignedInt(combinedl) ^ bitflipl); if (null != result) { @@ -393,10 +395,10 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr } return low; } - final long low = XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+64) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+72)); + final long low = XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 64) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 72)); if (null != result) { result[0] = low; - result[1] = XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+80) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+88)); + result[1] = XXH64_avalanche(seed ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 80) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 88)); } return low; } @@ -411,62 +413,62 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr final long input1 = access.i64(input, off + 48 + 8); final long input2 = access.i64(input, off + length - 64); final long input3 = access.i64(input, off + length - 64 + 8); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 96, acc0, input0, input1, input2, input3); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 96, acc0, input0, input1, input2, input3); acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 96 + 16, acc1, input2, input3, input0, input1); } final long input0 = access.i64(input, off + 32); final long input1 = access.i64(input, off + 32 + 8); final long input2 = access.i64(input, off + length - 48); final long input3 = access.i64(input, off + length - 48 + 8); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 64, acc0, input0, input1, input2, input3); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 64, acc0, input0, input1, input2, input3); acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 64 + 16, acc1, input2, input3, input0, input1); } final long input0 = access.i64(input, off + 16); final long input1 = access.i64(input, off + 16 + 8); final long input2 = access.i64(input, off + length - 32); final long input3 = access.i64(input, off + length - 32 + 8); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 32, acc0, input0, input1, input2, input3); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 32, acc0, input0, input1, input2, input3); acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 32 + 16, acc1, input2, input3, input0, input1); } final long input0 = access.i64(input, off + 0); final long input1 = access.i64(input, off + 0 + 8); final long input2 = access.i64(input, off + length - 16); final long input3 = access.i64(input, off + length - 16 + 8); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE, acc0, input0, input1, input2, input3); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE, acc0, input0, input1, input2, input3); acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 16, acc1, input2, input3, input0, input1); final long low = XXH3_avalanche(acc0 + acc1); if (null != result) { result[0] = low; - result[1] = -XXH3_avalanche(acc0*XXH_PRIME64_1 + acc1*XXH_PRIME64_4 + (length - seed)*XXH_PRIME64_2); + result[1] = -XXH3_avalanche(acc0 * XXH_PRIME64_1 + acc1 * XXH_PRIME64_4 + (length - seed) * XXH_PRIME64_2); } return low; } if (length <= 240) { // XXH3_len_129to240_128b - final int nbRounds = (int)length / 32; + final int nbRounds = (int) length / 32; long acc0 = length * XXH_PRIME64_1; long acc1 = 0; int i = 0; for (; i < 4; ++i) { - final long input0 = access.i64(input, off + 32*i); - final long input1 = access.i64(input, off + 32*i + 8); - final long input2 = access.i64(input, off + 32*i + 16); - final long input3 = access.i64(input, off + 32*i + 24); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 32*i, acc0, input0, input1, input2, input3); - acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 32*i + 16, acc1, input2, input3, input0, input1); + final long input0 = access.i64(input, off + 32 * i); + final long input1 = access.i64(input, off + 32 * i + 8); + final long input2 = access.i64(input, off + 32 * i + 16); + final long input3 = access.i64(input, off + 32 * i + 24); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 32 * i, acc0, input0, input1, input2, input3); + acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 32 * i + 16, acc1, input2, input3, input0, input1); } acc0 = XXH3_avalanche(acc0); acc1 = XXH3_avalanche(acc1); for (; i < nbRounds; ++i) { - final long input0 = access.i64(input, off + 32*i); - final long input1 = access.i64(input, off + 32*i + 8); - final long input2 = access.i64(input, off + 32*i + 16); - final long input3 = access.i64(input, off + 32*i + 24); - acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 3 + 32*(i-4), acc0, input0, input1, input2, input3); - acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 3 + 32*(i-4) + 16, acc1, input2, input3, input0, input1); + final long input0 = access.i64(input, off + 32 * i); + final long input1 = access.i64(input, off + 32 * i + 8); + final long input2 = access.i64(input, off + 32 * i + 16); + final long input3 = access.i64(input, off + 32 * i + 24); + acc0 = XXH128_mix32B_once(seed, BYTE_BASE + 3 + 32 * (i - 4), acc0, input0, input1, input2, input3); + acc1 = XXH128_mix32B_once(seed, BYTE_BASE + 3 + 32 * (i - 4) + 16, acc1, input2, input3, input0, input1); } /* last bytes */ @@ -475,12 +477,12 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr final long input2 = access.i64(input, off + length - 32); final long input3 = access.i64(input, off + length - 32 + 8); acc0 = XXH128_mix32B_once(-seed, BYTE_BASE + 136 - 17 - 16, acc0, input0, input1, input2, input3); - acc1 = XXH128_mix32B_once(-seed, BYTE_BASE + 136 - 17 , acc1, input2, input3, input0, input1); + acc1 = XXH128_mix32B_once(-seed, BYTE_BASE + 136 - 17, acc1, input2, input3, input0, input1); final long low = XXH3_avalanche(acc0 + acc1); if (null != result) { result[0] = low; - result[1] = -XXH3_avalanche(acc0*XXH_PRIME64_1 + acc1*XXH_PRIME64_4 + (length - seed)*XXH_PRIME64_2); + result[1] = -XXH3_avalanche(acc0 * XXH_PRIME64_1 + acc1 * XXH_PRIME64_4 + (length - seed) * XXH_PRIME64_2); } return low; } @@ -500,42 +502,42 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr for (long n = 0; n < nb_blocks; n++) { // XXH3_accumulate final long offBlock = off + n * block_len; - for (long s = 0; s < nbStripesPerBlock; s++ ) { + for (long s = 0; s < nbStripesPerBlock; s++) { // XXH3_accumulate_512 final long offStripe = offBlock + s * 64; final long offSec = s * 8; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -544,14 +546,14 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr // XXH3_scrambleAcc_scalar final long offSec = BYTE_BASE + 192 - 64; - acc_0 = (acc_0 ^ (acc_0 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*0)) * XXH_PRIME32_1; - acc_1 = (acc_1 ^ (acc_1 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*1)) * XXH_PRIME32_1; - acc_2 = (acc_2 ^ (acc_2 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*2)) * XXH_PRIME32_1; - acc_3 = (acc_3 ^ (acc_3 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*3)) * XXH_PRIME32_1; - acc_4 = (acc_4 ^ (acc_4 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*4)) * XXH_PRIME32_1; - acc_5 = (acc_5 ^ (acc_5 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*5)) * XXH_PRIME32_1; - acc_6 = (acc_6 ^ (acc_6 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*6)) * XXH_PRIME32_1; - acc_7 = (acc_7 ^ (acc_7 >>> 47) ^ unsafeLE.i64(secret, offSec + 8*7)) * XXH_PRIME32_1; + acc_0 = (acc_0 ^ (acc_0 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 0)) * XXH_PRIME32_1; + acc_1 = (acc_1 ^ (acc_1 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 1)) * XXH_PRIME32_1; + acc_2 = (acc_2 ^ (acc_2 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 2)) * XXH_PRIME32_1; + acc_3 = (acc_3 ^ (acc_3 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 3)) * XXH_PRIME32_1; + acc_4 = (acc_4 ^ (acc_4 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 4)) * XXH_PRIME32_1; + acc_5 = (acc_5 ^ (acc_5 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 5)) * XXH_PRIME32_1; + acc_6 = (acc_6 ^ (acc_6 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 6)) * XXH_PRIME32_1; + acc_7 = (acc_7 ^ (acc_7 >>> 47) ^ unsafeLE.i64(secret, offSec + 8 * 7)) * XXH_PRIME32_1; } /* last partial block */ @@ -562,37 +564,37 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr final long offStripe = offBlock + s * 64; final long offSec = s * 8; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -604,37 +606,37 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr final long offStripe = off + length - 64; final long offSec = 192 - 64 - 7; { - final long data_val_0 = access.i64(input, offStripe + 8*0); - final long data_val_1 = access.i64(input, offStripe + 8*1); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*0); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*1); + final long data_val_0 = access.i64(input, offStripe + 8 * 0); + final long data_val_1 = access.i64(input, offStripe + 8 * 1); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 0); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 1); /* swap adjacent lanes */ acc_0 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_1 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*2); - final long data_val_1 = access.i64(input, offStripe + 8*3); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*2); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*3); + final long data_val_0 = access.i64(input, offStripe + 8 * 2); + final long data_val_1 = access.i64(input, offStripe + 8 * 3); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 2); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 3); /* swap adjacent lanes */ acc_2 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_3 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*4); - final long data_val_1 = access.i64(input, offStripe + 8*5); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*4); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*5); + final long data_val_0 = access.i64(input, offStripe + 8 * 4); + final long data_val_1 = access.i64(input, offStripe + 8 * 5); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 4); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 5); /* swap adjacent lanes */ acc_4 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_5 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); } { - final long data_val_0 = access.i64(input, offStripe + 8*6); - final long data_val_1 = access.i64(input, offStripe + 8*7); - final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*6); - final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8*7); + final long data_val_0 = access.i64(input, offStripe + 8 * 6); + final long data_val_1 = access.i64(input, offStripe + 8 * 7); + final long data_key_0 = data_val_0 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 6); + final long data_key_1 = data_val_1 ^ unsafeLE.i64(secret, BYTE_BASE + offSec + 8 * 7); /* swap adjacent lanes */ acc_6 += data_val_1 + (0xFFFFFFFFL & data_key_0) * (data_key_0 >>> 32); acc_7 += data_val_0 + (0xFFFFFFFFL & data_key_1) * (data_key_1 >>> 32); @@ -660,9 +662,9 @@ private static long XXH3_128bits_internal(final long seed, final byte[] secr private static void XXH3_initCustomSecret(final byte[] customSecret, final long seed64) { final int nbRounds = 192 / 16; final ByteBuffer bb = ByteBuffer.wrap(customSecret).order(LITTLE_ENDIAN); - for (int i=0; i < nbRounds; i++) { - final long lo = unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 16*i) + seed64; - final long hi = unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 16*i + 8) - seed64; + for (int i = 0; i < nbRounds; i++) { + final long lo = unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 16 * i) + seed64; + final long hi = unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 16 * i + 8) - seed64; bb.putLong(16 * i + 0, lo); bb.putLong(16 * i + 8, hi); } @@ -684,7 +686,7 @@ public long seed() { public long hashLong(long input) { input = Primitives.nativeToLittleEndian(input); final long s = seed() ^ Long.reverseBytes(seed() & 0xFFFFFFFFL); - final long bitflip = (unsafeLE.i64(XXH3.XXH3_kSecret, 8+BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 16+BYTE_BASE)) - s; + final long bitflip = (unsafeLE.i64(XXH3.XXH3_kSecret, 8 + BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 16 + BYTE_BASE)) - s; final long keyed = Long.rotateLeft(input, 32) ^ bitflip; return XXH3_rrmxmx(keyed, 8); } @@ -693,19 +695,19 @@ public long hashLong(long input) { public long hashInt(int input) { input = Primitives.nativeToLittleEndian(input); long s = seed() ^ Long.reverseBytes(seed() & 0xFFFFFFFFL); - final long bitflip = (unsafeLE.i64(XXH3.XXH3_kSecret, 8+BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 16+BYTE_BASE)) - s; - final long keyed = (Primitives.unsignedInt(input) + (((long)input) << 32)) ^ bitflip; + final long bitflip = (unsafeLE.i64(XXH3.XXH3_kSecret, 8 + BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 16 + BYTE_BASE)) - s; + final long keyed = (Primitives.unsignedInt(input) + (((long) input) << 32)) ^ bitflip; return XXH3_rrmxmx(keyed, 4); } @Override public long hashShort(short input) { input = Primitives.nativeToLittleEndian(input); - final int c1 = Primitives.unsignedByte((byte)input); + final int c1 = Primitives.unsignedByte((byte) input); final int c2 = Primitives.unsignedShort(input) >>> 8; final int c3 = c2; final long combined = Primitives.unsignedInt((c1 << 16) | (c2 << 24) | c3 | (2 << 8)); - final long bitflip = (unsafeLE.u32(XXH3.XXH3_kSecret, BYTE_BASE) ^ unsafeLE.u32(XXH3.XXH3_kSecret, 4+BYTE_BASE)) + seed(); + final long bitflip = (unsafeLE.u32(XXH3.XXH3_kSecret, BYTE_BASE) ^ unsafeLE.u32(XXH3.XXH3_kSecret, 4 + BYTE_BASE)) + seed(); return XXH64_avalanche(combined ^ bitflip); } @@ -720,13 +722,13 @@ public long hashByte(byte input) { final int c2 = c1; final int c3 = c1; final long combined = Primitives.unsignedInt((c1 << 16) | (c2 << 24) | c3 | (1 << 8)); - final long bitflip = (unsafeLE.u32(XXH3.XXH3_kSecret, BYTE_BASE) ^ unsafeLE.u32(XXH3.XXH3_kSecret, 4+BYTE_BASE)) + seed(); + final long bitflip = (unsafeLE.u32(XXH3.XXH3_kSecret, BYTE_BASE) ^ unsafeLE.u32(XXH3.XXH3_kSecret, 4 + BYTE_BASE)) + seed(); return XXH64_avalanche(combined ^ bitflip); } @Override public long hashVoid() { - return XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3.XXH3_kSecret, 56+BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 64+BYTE_BASE)); + return XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3.XXH3_kSecret, 56 + BYTE_BASE) ^ unsafeLE.i64(XXH3.XXH3_kSecret, 64 + BYTE_BASE)); } @Override @@ -764,6 +766,7 @@ public long hash(final T input, final Access access, final long off, fina static LongTupleHashFunction asLongTupleHashFunctionWithoutSeed() { return AsLongTupleHashFunction.SEEDLESS_INSTANCE; } + static LongHashFunction asLongTupleLowHashFunctionWithoutSeed() { return AsLongTupleHashFunction.SEEDLESS_INSTANCE.asLongHashFunction(); } @@ -790,7 +793,7 @@ public long[] newResultArray() { public long dualHashLong(long input, final long[] result) { input = Primitives.nativeToLittleEndian(input); long s = seed() ^ Long.reverseBytes(seed() & 0xFFFFFFFFL); - final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24+BYTE_BASE)) + s; + final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24 + BYTE_BASE)) + s; final long keyed = input ^ bitflip; final long pl = XXH_PRIME64_1 + (8 << 2); /* Shift len to the left to ensure it is even, this avoids even multiplies. */ long m128_lo = keyed * pl; @@ -813,7 +816,7 @@ public long dualHashLong(long input, final long[] result) { public long dualHashInt(final int input, final long[] result) { final long inputU = Primitives.unsignedInt(Primitives.nativeToLittleEndian(input)); long s = seed() ^ Long.reverseBytes(seed() & 0xFFFFFFFFL); - final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16+BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24+BYTE_BASE)) + s; + final long bitflip = (unsafeLE.i64(XXH3_kSecret, 16 + BYTE_BASE) ^ unsafeLE.i64(XXH3_kSecret, 24 + BYTE_BASE)) + s; final long keyed = (inputU + (inputU << 32)) ^ bitflip; final long pl = XXH_PRIME64_1 + (4 << 2); /* Shift len to the left to ensure it is even, this avoids even multiplies. */ long m128_lo = keyed * pl; @@ -836,13 +839,13 @@ public long dualHashInt(final int input, final long[] result) { @Override public long dualHashShort(short input, final long[] result) { input = Primitives.nativeToLittleEndian(input); - final int c1 = Primitives.unsignedByte((byte)input); + final int c1 = Primitives.unsignedByte((byte) input); final int c2 = Primitives.unsignedShort(input) >>> 8; final int c3 = c2; - final int combinedl = (c1 << 16) | (c2 << 24) | c3 | (2 << 8); + final int combinedl = (c1 << 16) | (c2 << 24) | c3 | (2 << 8); final int combinedh = Integer.rotateLeft(Integer.reverseBytes(combinedl), 13); - final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+4)) + seed(); - final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE+8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+12)) - seed(); + final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 4)) + seed(); + final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 12)) - seed(); final long low = XXH64_avalanche(Primitives.unsignedInt(combinedl) ^ bitflipl); if (null != result) { @@ -861,12 +864,12 @@ public long dualHashChar(char input, final long[] result) { public long dualHashByte(byte input, final long[] result) { final int c1 = Primitives.unsignedByte(input); //final int c2 = c1; - final int c2 = (byte)input; + final int c2 = (byte) input; final int c3 = c1; - final int combinedl = (c1 << 16) | (c2 << 24) | c3 | (1 << 8); + final int combinedl = (c1 << 16) | (c2 << 24) | c3 | (1 << 8); final int combinedh = Integer.rotateLeft(Integer.reverseBytes(combinedl), 13); - final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+4)) + seed(); - final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE+8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE+12)) - seed(); + final long bitflipl = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 4)) + seed(); + final long bitfliph = Primitives.unsignedInt(unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 8) ^ unsafeLE.i32(XXH3_kSecret, BYTE_BASE + 12)) - seed(); final long low = XXH64_avalanche(Primitives.unsignedInt(combinedl) ^ bitflipl); if (null != result) { @@ -878,10 +881,10 @@ public long dualHashByte(byte input, final long[] result) { @Override public long dualHashVoid(final long[] result) { - final long low = XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+64) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+72)); + final long low = XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 64) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 72)); if (null != result) { result[0] = low; - result[1] = XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+80) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE+88)); + result[1] = XXH64_avalanche(seed() ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 80) ^ unsafeLE.i64(XXH3_kSecret, BYTE_BASE + 88)); } return low; } @@ -895,6 +898,7 @@ public long dualHash(final T input, final Access access, final long off, static LongTupleHashFunction asLongTupleHashFunctionWithSeed(final long seed) { return 0 == seed ? AsLongTupleHashFunction.SEEDLESS_INSTANCE : new AsLongTupleHashFunctionSeeded(seed); } + static LongHashFunction asLongTupleLowHashFunctionWithSeed(long seed) { return new AsLongTupleHashFunctionSeeded(seed).asLongHashFunction(); } diff --git a/src/main/java/net/openhft/hashing/XxHash.java b/src/main/java/net/openhft/hashing/XxHash.java index 4bc8455..a945d57 100644 --- a/src/main/java/net/openhft/hashing/XxHash.java +++ b/src/main/java/net/openhft/hashing/XxHash.java @@ -49,9 +49,9 @@ static long xxHash64(long seed, T input, Access access, long off, long le } while (remaining >= 32); hash = Long.rotateLeft(v1, 1) - + Long.rotateLeft(v2, 7) - + Long.rotateLeft(v3, 12) - + Long.rotateLeft(v4, 18); + + Long.rotateLeft(v2, 7) + + Long.rotateLeft(v3, 12) + + Long.rotateLeft(v4, 18); v1 *= P2; v1 = Long.rotateLeft(v1, 31); diff --git a/src/main/java/sun/nio/ch/DirectBuffer.java b/src/main/java/sun/nio/ch/DirectBuffer.java index 01b65e5..de23b7e 100644 --- a/src/main/java/sun/nio/ch/DirectBuffer.java +++ b/src/main/java/sun/nio/ch/DirectBuffer.java @@ -7,10 +7,10 @@ * Stub for JDK internal ckass sun.nio.ch.DirectBuffer. *

* - When crossing compiling for Java SE 7 and 8, this stub class bypasses compiler sun-api - * warnings. + * warnings. * - When crossing compiling for Java SE 9+, the package 'sun.nio.ch' is not exported from - * 'java.base' module. This stub class helps to access the class in compile-time without - * '--add-export' arguments and bypasses sun-api warnings. + * 'java.base' module. This stub class helps to access the class in compile-time without + * '--add-export' arguments and bypasses sun-api warnings. * - Only used methods are exported. * - In test and production runtime, the real class is loaded from boot classpath. */ diff --git a/src/test/java/net/openhft/hashing/CharSequenceAccessTest.java b/src/test/java/net/openhft/hashing/CharSequenceAccessTest.java index c7495b3..7992b68 100644 --- a/src/test/java/net/openhft/hashing/CharSequenceAccessTest.java +++ b/src/test/java/net/openhft/hashing/CharSequenceAccessTest.java @@ -5,15 +5,13 @@ import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assume.assumeTrue; import static java.nio.ByteOrder.*; import static net.openhft.hashing.Primitives.*; +import static org.junit.Assert.*; +import static org.junit.Assume.assumeTrue; public class CharSequenceAccessTest { - static String TEST_STRING = new String(new char[] {0xF0E1,0xD2C3,0xB4A5,0x9687,0xC8E9}); + static String TEST_STRING = new String(new char[]{0xF0E1, 0xD2C3, 0xB4A5, 0x9687, 0xC8E9}); @Test public void testInstanceLE() { @@ -57,37 +55,37 @@ public void testLittleEndian() { final Access access = CharSequenceAccess.charSequenceAccess(LITTLE_ENDIAN); final Access accessR = access.reverseAccess(); - assertEquals( 0x9687B4A5D2C3F0E1L, access.getLong(TEST_STRING, 0)); - assertEquals(0xE99687B4A5D2C3F0L , access.getLong(TEST_STRING, 1)); - assertEquals(0xE1F0C3D2A5B48796L , accessR.getLong(TEST_STRING, 0)); - assertEquals( 0xF0C3D2A5B48796E9L, accessR.getLong(TEST_STRING, 1)); - - assertEquals(unsignedInt( 0xD2C3F0E1), access.getUnsignedInt(TEST_STRING, 0)); - assertEquals(unsignedInt(0xA5D2C3F0 ), access.getUnsignedInt(TEST_STRING, 1)); - assertEquals( 0xD2C3F0E1, access.getInt(TEST_STRING, 0)); - assertEquals(0xA5D2C3F0 , access.getInt(TEST_STRING, 1)); - assertEquals(unsignedInt(0xE1F0C3D2) , accessR.getUnsignedInt(TEST_STRING, 0)); - assertEquals(unsignedInt( 0xF0C3D2A5), accessR.getUnsignedInt(TEST_STRING, 1)); - assertEquals(0xE1F0C3D2 , accessR.getInt(TEST_STRING, 0)); - assertEquals( 0xF0C3D2A5, accessR.getInt(TEST_STRING, 1)); - - assertEquals(unsignedShort( 0xF0E1), access.getUnsignedShort(TEST_STRING, 0)); - assertEquals(unsignedShort(0xC3F0 ), access.getUnsignedShort(TEST_STRING, 1)); - assertEquals((int)(short) 0xF0E1, access.getShort(TEST_STRING, 0)); - assertEquals((int)(short)0xC3F0 , access.getShort(TEST_STRING, 1)); - assertEquals(unsignedShort(0xE1F0 ), accessR.getUnsignedShort(TEST_STRING, 0)); - assertEquals(unsignedShort( 0xF0C3), accessR.getUnsignedShort(TEST_STRING, 1)); - assertEquals((int)(short)0xE1F0 , accessR.getShort(TEST_STRING, 0)); - assertEquals((int)(short) 0xF0C3, accessR.getShort(TEST_STRING, 1)); + assertEquals(0x9687B4A5D2C3F0E1L, access.getLong(TEST_STRING, 0)); + assertEquals(0xE99687B4A5D2C3F0L, access.getLong(TEST_STRING, 1)); + assertEquals(0xE1F0C3D2A5B48796L, accessR.getLong(TEST_STRING, 0)); + assertEquals(0xF0C3D2A5B48796E9L, accessR.getLong(TEST_STRING, 1)); + + assertEquals(unsignedInt(0xD2C3F0E1), access.getUnsignedInt(TEST_STRING, 0)); + assertEquals(unsignedInt(0xA5D2C3F0), access.getUnsignedInt(TEST_STRING, 1)); + assertEquals(0xD2C3F0E1, access.getInt(TEST_STRING, 0)); + assertEquals(0xA5D2C3F0, access.getInt(TEST_STRING, 1)); + assertEquals(unsignedInt(0xE1F0C3D2), accessR.getUnsignedInt(TEST_STRING, 0)); + assertEquals(unsignedInt(0xF0C3D2A5), accessR.getUnsignedInt(TEST_STRING, 1)); + assertEquals(0xE1F0C3D2, accessR.getInt(TEST_STRING, 0)); + assertEquals(0xF0C3D2A5, accessR.getInt(TEST_STRING, 1)); + + assertEquals(unsignedShort(0xF0E1), access.getUnsignedShort(TEST_STRING, 0)); + assertEquals(unsignedShort(0xC3F0), access.getUnsignedShort(TEST_STRING, 1)); + assertEquals((int) (short) 0xF0E1, access.getShort(TEST_STRING, 0)); + assertEquals((int) (short) 0xC3F0, access.getShort(TEST_STRING, 1)); + assertEquals(unsignedShort(0xE1F0), accessR.getUnsignedShort(TEST_STRING, 0)); + assertEquals(unsignedShort(0xF0C3), accessR.getUnsignedShort(TEST_STRING, 1)); + assertEquals((int) (short) 0xE1F0, accessR.getShort(TEST_STRING, 0)); + assertEquals((int) (short) 0xF0C3, accessR.getShort(TEST_STRING, 1)); assertEquals(unsignedByte(0xE1), access.getUnsignedByte(TEST_STRING, 0)); assertEquals(unsignedByte(0xF0), access.getUnsignedByte(TEST_STRING, 1)); - assertEquals((int)(byte)0xE1, access.getByte(TEST_STRING, 0)); - assertEquals((int)(byte)0xF0, access.getByte(TEST_STRING, 1)); + assertEquals((int) (byte) 0xE1, access.getByte(TEST_STRING, 0)); + assertEquals((int) (byte) 0xF0, access.getByte(TEST_STRING, 1)); assertEquals(unsignedByte(0xE1), accessR.getUnsignedByte(TEST_STRING, 0)); assertEquals(unsignedByte(0xF0), accessR.getUnsignedByte(TEST_STRING, 1)); - assertEquals((int)(byte)0xE1, accessR.getByte(TEST_STRING, 0)); - assertEquals((int)(byte)0xF0, accessR.getByte(TEST_STRING, 1)); + assertEquals((int) (byte) 0xE1, accessR.getByte(TEST_STRING, 0)); + assertEquals((int) (byte) 0xF0, accessR.getByte(TEST_STRING, 1)); } @Test @@ -96,22 +94,22 @@ public void testBigEndian() { final Access access = CharSequenceAccess.charSequenceAccess(BIG_ENDIAN); - assertEquals(0xF0E1D2C3B4A59687L , access.getLong(TEST_STRING, 0)); - assertEquals( 0xE1D2C3B4A59687C8L, access.getLong(TEST_STRING, 1)); + assertEquals(0xF0E1D2C3B4A59687L, access.getLong(TEST_STRING, 0)); + assertEquals(0xE1D2C3B4A59687C8L, access.getLong(TEST_STRING, 1)); assertEquals(unsignedInt(0xF0E1D2C3), access.getUnsignedInt(TEST_STRING, 0)); - assertEquals(unsignedInt( 0xE1D2C3B4), access.getUnsignedInt(TEST_STRING, 1)); + assertEquals(unsignedInt(0xE1D2C3B4), access.getUnsignedInt(TEST_STRING, 1)); assertEquals(0xF0E1D2C3, access.getInt(TEST_STRING, 0)); - assertEquals( 0xE1D2C3B4, access.getInt(TEST_STRING, 1)); + assertEquals(0xE1D2C3B4, access.getInt(TEST_STRING, 1)); assertEquals(unsignedShort(0xF0E1), access.getUnsignedShort(TEST_STRING, 0)); - assertEquals(unsignedShort( 0xE1D2), access.getUnsignedShort(TEST_STRING, 1)); - assertEquals((int)(short)0xF0E1, access.getShort(TEST_STRING, 0)); - assertEquals((int)(short) 0xE1D2, access.getShort(TEST_STRING, 1)); + assertEquals(unsignedShort(0xE1D2), access.getUnsignedShort(TEST_STRING, 1)); + assertEquals((int) (short) 0xF0E1, access.getShort(TEST_STRING, 0)); + assertEquals((int) (short) 0xE1D2, access.getShort(TEST_STRING, 1)); assertEquals(unsignedByte(0xF0), access.getUnsignedByte(TEST_STRING, 0)); assertEquals(unsignedByte(0xE1), access.getUnsignedByte(TEST_STRING, 1)); - assertEquals((int)(byte)0xF0, access.getByte(TEST_STRING, 0)); - assertEquals((int)(byte)0xE1, access.getByte(TEST_STRING, 1)); + assertEquals((int) (byte) 0xF0, access.getByte(TEST_STRING, 0)); + assertEquals((int) (byte) 0xE1, access.getByte(TEST_STRING, 1)); } } diff --git a/src/test/java/net/openhft/hashing/City64_1_1_Test.java b/src/test/java/net/openhft/hashing/City64_1_1_Test.java index 73654f3..df91513 100644 --- a/src/test/java/net/openhft/hashing/City64_1_1_Test.java +++ b/src/test/java/net/openhft/hashing/City64_1_1_Test.java @@ -20,7 +20,7 @@ public class City64_1_1_Test { public static Collection data() { ArrayList data = new ArrayList(); for (int len = 0; len < 1025; len++) { - data.add(new Object[] {len}); + data.add(new Object[]{len}); } return data; } diff --git a/src/test/java/net/openhft/hashing/CompactLatin1CharSequenceAccessTest.java b/src/test/java/net/openhft/hashing/CompactLatin1CharSequenceAccessTest.java index f79ad24..bafaa8d 100644 --- a/src/test/java/net/openhft/hashing/CompactLatin1CharSequenceAccessTest.java +++ b/src/test/java/net/openhft/hashing/CompactLatin1CharSequenceAccessTest.java @@ -4,6 +4,7 @@ package net.openhft.hashing; import org.junit.Test; + import java.nio.ByteOrder; import static java.nio.ByteOrder.BIG_ENDIAN; @@ -13,51 +14,51 @@ public class CompactLatin1CharSequenceAccessTest { static private final Access access = CompactLatin1CharSequenceAccess.INSTANCE; - static private final byte[] b = { (byte)0xF1, (byte)0xE2, (byte)0xD3, (byte)0xC4, (byte)0xB5 }; + static private final byte[] b = {(byte) 0xF1, (byte) 0xE2, (byte) 0xD3, (byte) 0xC4, (byte) 0xB5}; @Test public void testLE() { assumeTrue(ByteOrder.nativeOrder() == LITTLE_ENDIAN); - assertEquals( 0xC400D300E200F1L, access.getLong(b, 0)); - assertEquals(0xB500C400D300E200L, access.getLong(b, 1)); + assertEquals(0xC400D300E200F1L, access.getLong(b, 0)); + assertEquals(0xB500C400D300E200L, access.getLong(b, 1)); - assertEquals( 0xE200F1, access.getInt(b, 0)); - assertEquals( 0xD300E200, access.getInt(b, 1)); - assertEquals(Primitives.unsignedInt(0xE200F1), access.getUnsignedInt(b, 0)); + assertEquals(0xE200F1, access.getInt(b, 0)); + assertEquals(0xD300E200, access.getInt(b, 1)); + assertEquals(Primitives.unsignedInt(0xE200F1), access.getUnsignedInt(b, 0)); assertEquals(Primitives.unsignedInt(0xD300E200), access.getUnsignedInt(b, 1)); - assertEquals( 0xF1, access.getShort(b, 0)); - assertEquals( (int)(short)0xE200, access.getShort(b, 1)); - assertEquals(Primitives.unsignedShort(0xF1), access.getUnsignedShort(b, 0)); + assertEquals(0xF1, access.getShort(b, 0)); + assertEquals((int) (short) 0xE200, access.getShort(b, 1)); + assertEquals(Primitives.unsignedShort(0xF1), access.getUnsignedShort(b, 0)); assertEquals(Primitives.unsignedShort(0xE200), access.getUnsignedShort(b, 1)); - assertEquals( (int)(byte)0xF1, access.getByte(b, 0)); - assertEquals( 0, access.getByte(b, 1)); + assertEquals((int) (byte) 0xF1, access.getByte(b, 0)); + assertEquals(0, access.getByte(b, 1)); assertEquals(Primitives.unsignedByte(0xF1), access.getUnsignedByte(b, 0)); - assertEquals( 0, access.getUnsignedByte(b, 1)); + assertEquals(0, access.getUnsignedByte(b, 1)); } @Test public void testBE() { assumeTrue(ByteOrder.nativeOrder() == BIG_ENDIAN); - assertEquals(0xF100E200D300C4L, access.getLong(b, 0)); + assertEquals(0xF100E200D300C4L, access.getLong(b, 0)); assertEquals(0xF100E200D300C400L, access.getLong(b, 1)); - assertEquals( 0xF100E2, access.getInt(b, 0)); - assertEquals( 0xF100E200, access.getInt(b, 1)); - assertEquals(Primitives.unsignedInt(0xF100E2), access.getUnsignedInt(b, 0)); + assertEquals(0xF100E2, access.getInt(b, 0)); + assertEquals(0xF100E200, access.getInt(b, 1)); + assertEquals(Primitives.unsignedInt(0xF100E2), access.getUnsignedInt(b, 0)); assertEquals(Primitives.unsignedInt(0xF100E200), access.getUnsignedInt(b, 1)); - assertEquals( 0xF1, access.getShort(b, 0)); - assertEquals( (int)(short)0xF100, access.getShort(b, 1)); - assertEquals(Primitives.unsignedShort(0xF1), access.getUnsignedShort(b, 0)); + assertEquals(0xF1, access.getShort(b, 0)); + assertEquals((int) (short) 0xF100, access.getShort(b, 1)); + assertEquals(Primitives.unsignedShort(0xF1), access.getUnsignedShort(b, 0)); assertEquals(Primitives.unsignedShort(0xF100), access.getUnsignedShort(b, 1)); - assertEquals( 0, access.getByte(b, 0)); - assertEquals( (int)(byte)0xF1, access.getByte(b, 1)); - assertEquals( 0, access.getUnsignedByte(b, 0)); + assertEquals(0, access.getByte(b, 0)); + assertEquals((int) (byte) 0xF1, access.getByte(b, 1)); + assertEquals(0, access.getUnsignedByte(b, 0)); assertEquals(Primitives.unsignedByte(0xF1), access.getUnsignedByte(b, 1)); } } diff --git a/src/test/java/net/openhft/hashing/LongHashFunctionTest.java b/src/test/java/net/openhft/hashing/LongHashFunctionTest.java index fa4380a..6510842 100644 --- a/src/test/java/net/openhft/hashing/LongHashFunctionTest.java +++ b/src/test/java/net/openhft/hashing/LongHashFunctionTest.java @@ -8,12 +8,8 @@ import java.nio.ByteOrder; import java.util.Arrays; -import static java.nio.ByteOrder.BIG_ENDIAN; -import static java.nio.ByteOrder.LITTLE_ENDIAN; -import static java.nio.ByteOrder.nativeOrder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.fail; +import static java.nio.ByteOrder.*; +import static org.junit.Assert.*; class LongHashFunctionTest { @@ -43,7 +39,7 @@ private static void testVoid(LongHashFunction f, long eh, int len) { private static void testBoolean(LongHashFunction f, int len) { if (len != 1) return; - for (boolean b : new boolean[] {true, false}) { + for (boolean b : new boolean[]{true, false}) { boolean[] a = {b}; long single = f.hashBoolean(b); long array = f.hashBooleans(a); @@ -148,17 +144,17 @@ private static void testByteBuffers(LongHashFunction f, long eh, int len, ByteBu bb.order(LITTLE_ENDIAN); assertEquals("byte buffer little endian", eh, f.hashBytes(bb)); ByteBuffer bb2 = ByteBuffer.allocate(len + 2).order(LITTLE_ENDIAN); - ((Buffer)bb2).position(1); + ((Buffer) bb2).position(1); bb2.put(bb); assertEquals("byte buffer little endian off len", eh, f.hashBytes(bb2, 1, len)); - ((Buffer)bb.order(BIG_ENDIAN)).clear(); + ((Buffer) bb.order(BIG_ENDIAN)).clear(); assertEquals("byte buffer big endian", eh, f.hashBytes(bb)); bb2.order(BIG_ENDIAN); assertEquals("byte buffer big endian off len", eh, f.hashBytes(bb2, 1, len)); - ((Buffer)bb.order(nativeOrder())).clear(); + ((Buffer) bb.order(nativeOrder())).clear(); } private static void testCharSequences(LongHashFunction f, long eh, int len, ByteBuffer bb) { @@ -188,7 +184,7 @@ private static void testCharSequences(LongHashFunction f, long eh, int len, Byte long toCharSequenceActual = f.hash(s2, Access.toCharSequence(nonNativeOrder()), 0, len); assertEquals("string wrong order fixed", eh, toCharSequenceActual); - ((Buffer)bb.order(nativeOrder())).clear(); + ((Buffer) bb.order(nativeOrder())).clear(); } } } @@ -197,7 +193,7 @@ private static void testMemory(LongHashFunction f, long eh, int len, ByteBuffer ByteBuffer directBB = ByteBuffer.allocateDirect(len); directBB.put(bb); assertEquals("memory", eh, f.hashMemory(Util.getDirectBufferAddress(directBB), len)); - ((Buffer)bb).clear(); + ((Buffer) bb).clear(); } private static void testLatin1String(LongHashFunction f, byte[] data) { @@ -206,7 +202,7 @@ private static void testLatin1String(LongHashFunction f, byte[] data) { String inputStr = new String(data, "ISO-8859-1"); char[] inputCharArray = new char[data.length]; for (int i = 0; i < data.length; ++i) { - inputCharArray[i] = (char)(data[i]&0xFF); + inputCharArray[i] = (char) (data[i] & 0xFF); } assertEquals(f.hashChars(inputStr), f.hashChars(inputCharArray)); } catch (Exception e) { diff --git a/src/test/java/net/openhft/hashing/LongTupleHashFunctionTest.java b/src/test/java/net/openhft/hashing/LongTupleHashFunctionTest.java index 9781aa2..78b4073 100644 --- a/src/test/java/net/openhft/hashing/LongTupleHashFunctionTest.java +++ b/src/test/java/net/openhft/hashing/LongTupleHashFunctionTest.java @@ -8,17 +8,11 @@ import java.nio.ByteOrder; import java.util.Arrays; -import static java.nio.ByteOrder.BIG_ENDIAN; -import static java.nio.ByteOrder.LITTLE_ENDIAN; -import static java.nio.ByteOrder.nativeOrder; +import static java.nio.ByteOrder.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsNot.not; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; class LongTupleHashFunctionTest { @@ -95,7 +89,7 @@ private static void testVoid(LongTupleHashFunction f, long[] eh, int len) { private static void testBoolean(LongTupleHashFunction f, int len) { if (len != 1) return; - for (boolean b : new boolean[] {true, false}) { + for (boolean b : new boolean[]{true, false}) { boolean[] a = {b}; long[] single = f.hashBoolean(b); long[] array = f.hashBooleans(a); @@ -200,17 +194,17 @@ private static void testByteBuffers(LongTupleHashFunction f, long[] eh, int len, bb.order(LITTLE_ENDIAN); assertArrayEquals("byte buffer little endian", eh, f.hashBytes(bb)); ByteBuffer bb2 = ByteBuffer.allocate(len + 2).order(LITTLE_ENDIAN); - ((Buffer)bb2).position(1); + ((Buffer) bb2).position(1); bb2.put(bb); assertArrayEquals("byte buffer little endian off len", eh, f.hashBytes(bb2, 1, len)); - ((Buffer)bb.order(BIG_ENDIAN)).clear(); + ((Buffer) bb.order(BIG_ENDIAN)).clear(); assertArrayEquals("byte buffer big endian", eh, f.hashBytes(bb)); bb2.order(BIG_ENDIAN); assertArrayEquals("byte buffer big endian off len", eh, f.hashBytes(bb2, 1, len)); - ((Buffer)bb.order(nativeOrder())).clear(); + ((Buffer) bb.order(nativeOrder())).clear(); } private static void testCharSequences(LongTupleHashFunction f, long[] eh, int len, ByteBuffer bb) { @@ -240,7 +234,7 @@ private static void testCharSequences(LongTupleHashFunction f, long[] eh, int le long[] toCharSequenceActual = f.hash(s2, Access.toCharSequence(nonNativeOrder()), 0, len); assertArrayEquals("string wrong order fixed", eh, toCharSequenceActual); - ((Buffer)bb.order(nativeOrder())).clear(); + ((Buffer) bb.order(nativeOrder())).clear(); } } } @@ -249,7 +243,7 @@ private static void testMemory(LongTupleHashFunction f, long[] eh, int len, Byte ByteBuffer directBB = ByteBuffer.allocateDirect(len); directBB.put(bb); assertArrayEquals("memory", eh, f.hashMemory(Util.getDirectBufferAddress(directBB), len)); - ((Buffer)bb).clear(); + ((Buffer) bb).clear(); } private static void testLatin1String(LongTupleHashFunction f, byte[] data) { @@ -258,11 +252,11 @@ private static void testLatin1String(LongTupleHashFunction f, byte[] data) { String inputStr = new String(data, "ISO-8859-1"); char[] inputCharArray = new char[data.length]; for (int i = 0; i < data.length; ++i) { - inputCharArray[i] = (char)(data[i]&0xFF); + inputCharArray[i] = (char) (data[i] & 0xFF); } char[] inputCharArray2 = new char[data.length]; for (int i = 0; i < data.length; ++i) { - inputCharArray2[i] = (char)(data[i]&0xFF); + inputCharArray2[i] = (char) (data[i] & 0xFF); } assertArrayEquals(f.hashChars(inputStr), f.hashChars(inputCharArray)); } catch (Exception e) { diff --git a/src/test/java/net/openhft/hashing/MetroHashTest.java b/src/test/java/net/openhft/hashing/MetroHashTest.java index 3569291..295e247 100644 --- a/src/test/java/net/openhft/hashing/MetroHashTest.java +++ b/src/test/java/net/openhft/hashing/MetroHashTest.java @@ -43,32 +43,32 @@ private void test(LongHashFunction metro, long[] hashesOfLoopingBytes) { LongHashFunctionTest.test(metro, data, hashesOfLoopingBytes[len]); } -/** - * Test data is output of the following program with metrohash implementation - * from https://github.com/jandrewrogers/MetroHash - * - * #include "metrohash64.h" - * #include - * #include - * - * int main() { - * uint8_t* x = (uint8_t*) malloc(8); - * uint8_t* src = (uint8_t*) malloc(1024); - * for (int i = 0; i < 1024; i++) { - * src[i] = (uint8_t) i; - * } - * printf("without seeds\n"); - * for (int i = 0; i <= 1024; i++) { - * MetroHash64::Hash(src, i, x); - * printf("%lldL,\n", *((long long *)x)); - * } - * printf("with seed 42\n"); - * for (int i = 0; i <= 1024; i++) { - * MetroHash64::Hash(src, i, x, 42); - * printf("%lldL,\n", *((long long *)x)); - * } - * } - */ + /** + * Test data is output of the following program with metrohash implementation + * from https://github.com/jandrewrogers/MetroHash + *

+ * #include "metrohash64.h" + * #include + * #include + *

+ * int main() { + * uint8_t* x = (uint8_t*) malloc(8); + * uint8_t* src = (uint8_t*) malloc(1024); + * for (int i = 0; i < 1024; i++) { + * src[i] = (uint8_t) i; + * } + * printf("without seeds\n"); + * for (int i = 0; i <= 1024; i++) { + * MetroHash64::Hash(src, i, x); + * printf("%lldL,\n", *((long long *)x)); + * } + * printf("with seed 42\n"); + * for (int i = 0; i <= 1024; i++) { + * MetroHash64::Hash(src, i, x, 42); + * printf("%lldL,\n", *((long long *)x)); + * } + * } + */ private static final long[] HASHES_OF_LOOPING_BYTES_WITHOUT_SEED = { 8097384203561113213L, diff --git a/src/test/java/net/openhft/hashing/MurmurHash3Test.java b/src/test/java/net/openhft/hashing/MurmurHash3Test.java index 57a710d..23f6a8e 100644 --- a/src/test/java/net/openhft/hashing/MurmurHash3Test.java +++ b/src/test/java/net/openhft/hashing/MurmurHash3Test.java @@ -7,10 +7,9 @@ import com.google.common.hash.Hashing; import org.junit.Test; -import java.util.Arrays; -import java.util.Random; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.Arrays; public class MurmurHash3Test { diff --git a/src/test/java/net/openhft/hashing/OriginalFarmHashTest.java b/src/test/java/net/openhft/hashing/OriginalFarmHashTest.java index f93fb24..0f05e2c 100644 --- a/src/test/java/net/openhft/hashing/OriginalFarmHashTest.java +++ b/src/test/java/net/openhft/hashing/OriginalFarmHashTest.java @@ -66,10 +66,10 @@ private static long SEED1(int offset) { @Test public void testNa() { int expectedIndex = 0, i = 0; - for ( ; i < kTestSize - 1; i++) { + for (; i < kTestSize - 1; i++) { expectedIndex = testNa(i * i, i, expectedIndex); } - for ( ; i < kDataSize; i += i / 7) { + for (; i < kDataSize; i += i / 7) { expectedIndex = testNa(0, i, expectedIndex); } testNa(0, kDataSize, expectedIndex); @@ -97,10 +97,10 @@ private static int testNa(int offset, int len, int expectedIndex) { @Test public void testUo() { int expectedIndex = 0, i = 0; - for ( ; i < kTestSize - 1; i++) { + for (; i < kTestSize - 1; i++) { expectedIndex = testUo(i * i, i, expectedIndex); } - for ( ; i < kDataSize; i += i / 7) { + for (; i < kDataSize; i += i / 7) { expectedIndex = testUo(0, i, expectedIndex); } testUo(0, kDataSize, expectedIndex); @@ -125,7 +125,7 @@ public void testUoGo() { for (Object[] g : GOLDEN_64) { long hash = (Long) g[0]; try { - byte[] s = ((String)g[1]).getBytes("US-ASCII"); + byte[] s = ((String) g[1]).getBytes("US-ASCII"); Assert.assertEquals(hash, LongHashFunction.farmUo().hashBytes(s)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); diff --git a/src/test/java/net/openhft/hashing/PrimitivesTest.java b/src/test/java/net/openhft/hashing/PrimitivesTest.java index bd85d07..2e30bae 100644 --- a/src/test/java/net/openhft/hashing/PrimitivesTest.java +++ b/src/test/java/net/openhft/hashing/PrimitivesTest.java @@ -5,9 +5,7 @@ import org.junit.Test; -import static java.nio.ByteOrder.BIG_ENDIAN; -import static java.nio.ByteOrder.LITTLE_ENDIAN; -import static java.nio.ByteOrder.nativeOrder; +import static java.nio.ByteOrder.*; import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeTrue; diff --git a/src/test/java/net/openhft/hashing/UnsafeAccessTest.java b/src/test/java/net/openhft/hashing/UnsafeAccessTest.java index b3e5820..7318671 100644 --- a/src/test/java/net/openhft/hashing/UnsafeAccessTest.java +++ b/src/test/java/net/openhft/hashing/UnsafeAccessTest.java @@ -9,9 +9,7 @@ import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import static java.nio.ByteOrder.BIG_ENDIAN; -import static java.nio.ByteOrder.LITTLE_ENDIAN; -import static java.nio.ByteOrder.nativeOrder; +import static java.nio.ByteOrder.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; import static org.junit.Assume.assumeTrue; @@ -21,7 +19,7 @@ public class UnsafeAccessTest { @Parameters public static Object[] data() { - return new Object[] { UnsafeAccess.INSTANCE, UnsafeAccess.OLD_INSTANCE }; + return new Object[]{UnsafeAccess.INSTANCE, UnsafeAccess.OLD_INSTANCE}; } @Parameter @@ -57,7 +55,7 @@ public void testUnsafeAccess() { } { - final byte[] b = new byte[]{(byte)0xF4, 0x5D}; + final byte[] b = new byte[]{(byte) 0xF4, 0x5D}; assertEquals((int) b[0], unsafe.getByte(b, UnsafeAccess.BYTE_BASE)); assertEquals((int) b[1], unsafe.getByte(b, UnsafeAccess.BYTE_BASE + 1)); assertEquals(Primitives.unsignedByte(b[0]), unsafe.getUnsignedByte(b, UnsafeAccess.BYTE_BASE)); @@ -87,7 +85,7 @@ public void testUnsafeAccessUnalignLE() { } { - final byte[] b = new byte[]{(byte)0xF4, 0x5D}; + final byte[] b = new byte[]{(byte) 0xF4, 0x5D}; assertEquals((int) 0x5D, unsafe.getByte(b, UnsafeAccess.BYTE_BASE + 1)); assertEquals(Primitives.unsignedByte(0x5D), unsafe.getUnsignedByte(b, UnsafeAccess.BYTE_BASE + 1)); } @@ -115,7 +113,7 @@ public void testUnsafeAccessUnalignBE() { } { - final byte[] b = new byte[]{(byte)0xF4, 0x5D}; + final byte[] b = new byte[]{(byte) 0xF4, 0x5D}; assertEquals((int) 0x5D, unsafe.getByte(b, UnsafeAccess.BYTE_BASE + 1)); assertEquals(Primitives.unsignedByte(0x5D), unsafe.getUnsignedByte(b, UnsafeAccess.BYTE_BASE + 1)); } diff --git a/src/test/java/net/openhft/hashing/WyHashTest.java b/src/test/java/net/openhft/hashing/WyHashTest.java index 997fab6..a402e3d 100644 --- a/src/test/java/net/openhft/hashing/WyHashTest.java +++ b/src/test/java/net/openhft/hashing/WyHashTest.java @@ -39,7 +39,7 @@ private void test(LongHashFunction wyHash, long[] hashesOfLoopingBytes) { for (int j = 0; j < data.length; j++) { data[j] = (byte) j; } - LongHashFunctionTest .test(wyHash, data, hashesOfLoopingBytes[len]); + LongHashFunctionTest.test(wyHash, data, hashesOfLoopingBytes[len]); } /** @@ -70,2058 +70,2058 @@ private void test(LongHashFunction wyHash, long[] hashesOfLoopingBytes) { * <\pre> */ private static final long[] HASHES_OF_LOOPING_BYTES_WITHOUT_SEED = { - 0L, - -1498634010482895780L, - 6867524088326895660L, - 269206059098007870L, - -4886887581681798391L, - 3928433339794945779L, - 4316332308770427980L, - 2615655046588972881L, - 1900500844844731087L, - -937305021312369991L, - -8876585030919011822L, - -8568794208905766378L, - -7560937143015008723L, - 8498693544545256400L, - -2419449035530425220L, - 3329598615825088111L, - 1210853880152044769L, - 8924597104910535362L, - -3295737048979845383L, - -2077067637562286605L, - -1011034785208955521L, - -7140824109018505684L, - 1461819519553440317L, - 6436392319919688449L, - 9118839121464630705L, - -2917786468093466294L, - 504959295268162643L, - 6865609001872362604L, - 1331148763751586565L, - 5194938495997054762L, - 2665520052525504553L, - 276933320889118143L, - 4905118367340856460L, - 2074482748007873417L, - 33988220393155982L, - -1886632289327107396L, - 1961403923654424835L, - -2534868615627330587L, - 3462266467782463357L, - 7919120157912374187L, - -89126594710480197L, - -7042017916137112880L, - -7849604837443256405L, - 7183458575501572456L, - 5774439312980039315L, - -6565296715949686971L, - 8732951222530004068L, - 1900291206658974389L, - 7866927889483112715L, - 7328496947698938651L, - -8414002129273563525L, - -7507611883654277681L, - 1048916663450809742L, - 2886294206178088467L, - -8219721567024751529L, - 7725050882468238784L, - 3754847308658349557L, - -8413245846548203550L, - -3076479495605594465L, - -3121134529382168760L, - -8550177436169846333L, - -7635987039377529922L, - -5313723440094816160L, - -4177524123888580462L, - -1094315098609866806L, - 6577764665351221181L, - -7451684539960092493L, - 7061343558406187853L, - 871230336086645006L, - 6267395254690800101L, - 3141612453381470612L, - -8952205469861911532L, - 4767899395611465842L, - 7630515440353450329L, - -4985889236947520435L, - 4353614766406020339L, - 6903511086527962847L, - -4820634093847096378L, - 6452963341373240239L, - 8594720565063264398L, - -299303866433612643L, - 5948128939845193681L, - -6327319179549631842L, - 1661386658896970098L, - -387220913420000811L, - -9142963141159743830L, - -3957881162477548163L, - 7835579812652104509L, - -2179101728939025569L, - 1409259865195553628L, - 3329985067144149794L, - -4622006820323901246L, - -5489854929168527846L, - -4192684064311628792L, - -5930581590656743655L, - -8741322520672067800L, - -2532269067473596306L, - 2794660858881925622L, - -1660759460598522315L, - 4890293817527089205L, - 5011673154728255657L, - -2422404023490478452L, - -5823317675052947328L, - -1972153552478886407L, - 855875383009846790L, - 4539038924804919368L, - -3429781972296775524L, - -933120655172824074L, - 5340485644774899680L, - 1224352437979479512L, - -4247440279147522491L, - -2847066616858361472L, - 7303140713793758036L, - 177699726658531463L, - 7295117342573216781L, - -4960156472424071480L, - 8110395551125556627L, - 4814552517606903675L, - -5765636104388650769L, - -6413724172541333072L, - 8304733428601507939L, - 143869199545215598L, - -3363348007324106812L, - 778524423687782971L, - -3153748338449493859L, - 4072736150578731467L, - 2759867216020429817L, - 2328407206204809068L, - 3183594959296292673L, - 4716260652336579034L, - -2306094442378564227L, - 1612703725746980307L, - 9169273487926974528L, - 1221567220993136926L, - -1580158544177522978L, - -7978689145799920414L, - -8935536723451615449L, - -5386522443941349619L, - -2260007907190275450L, - -6109689112492865066L, - -7269857258080875354L, - 120767029125806560L, - 8179378742614718442L, - -1054596932535254740L, - -4819959080878920419L, - 6750654725339344085L, - 839742699455186248L, - 6590957420819328903L, - -8962195670723273636L, - 2970575532853857622L, - -2914121199343336253L, - -4719180678962776867L, - -3866803542764213986L, - 7340712279894103874L, - 665981095963825401L, - -7610703223561970702L, - -2285269148746390312L, - -7903336846335812333L, - 7602163920871488336L, - -2475707530835373762L, - 6488428233646685175L, - 781770467078860396L, - -1896921154761119070L, - 3650082028082002274L, - 1859676323486474137L, - -9056242232568275385L, - -1916274702525507105L, - -3359763315783254668L, - -6899438582509090070L, - -7391229595698815015L, - 7793799255007638001L, - -4654796168571058118L, - -9069457371238954514L, - -9079499580790007240L, - -2167538533996933224L, - -5375580275118212442L, - 1932479471587420530L, - 463274931357170593L, - -3434738247190694006L, - 8225681262889934868L, - 670972606916628978L, - -7016577201793262587L, - 9186141629236930525L, - -7494961908382494386L, - 6018069173542321620L, - 3178094810629815034L, - 4206446522733994268L, - -6087839594407260931L, - 3028792124204271051L, - -5992000926787926144L, - -6045285586180402268L, - -2566939030601076745L, - -6419778085488192839L, - -5937870815253811034L, - 3037623662402648617L, - 8475134681257527331L, - 7525467631675910914L, - -2155136652979576665L, - -8863297785379055796L, - -3708604617726301534L, - -1690991326769386459L, - -4914650490954752560L, - -3651000998051367684L, - 2310224359054007710L, - 6467643434506892008L, - -4675387411483580919L, - 1539479589290018260L, - -1317482399971130537L, - 4787089544028336616L, - -817342235353043974L, - 9005897661744065787L, - 1698757063019545437L, - -7450744880655832349L, - 941242980692041666L, - 3855717121175377711L, - 1838418961320954867L, - 7906600640157184104L, - 143774240320811355L, - -5033235558726049955L, - -3733441418159723230L, - 6322249537999722411L, - -3599749198660319070L, - 7881889296519703891L, - 8772851375938262713L, - -3694154014800677764L, - 5483806649985491869L, - 7467568598910778939L, - -839413141520398979L, - 1922118942992405635L, - 5178389178007203495L, - -2131625735310863702L, - -5210713408719608360L, - 969214743442701574L, - -6694519095627761288L, - -3987528749564960054L, - 6145126602437587352L, - -3312790047326848561L, - -5928158217897491190L, - -163692375920080658L, - -4638104573766795427L, - -8806888994476878747L, - -5569512305780637370L, - 1905174746960402451L, - -8994865683955938409L, - 6363190415094303315L, - -819892343899481166L, - 4997088889036354237L, - 7165251770996374856L, - 2252387190424353838L, - 3749847241214246299L, - 7255309255472237037L, - 4672295531818402039L, - -2560356144353793581L, - -2883403067265782436L, - 1079945501265719009L, - -4510676817588967577L, - 373333767776611969L, - -5012601232582215618L, - 2359976143593903713L, - -219011861965226894L, - 76910311444724969L, - 2854997659137560722L, - -6663673552428958663L, - 1647372533507817437L, - -3677652995772257250L, - 1062322309494793766L, - 3997004911860361768L, - -6239801180306730115L, - 7679085503289673770L, - 1937634364969511157L, - 5848969401602626006L, - 6881011614306732306L, - -1181711090074996330L, - 9115958678061403357L, - -4697019334186712846L, - -7555505080733309776L, - 833987302221784302L, - 5435944218394230630L, - 6255423471362246568L, - -4754437678222079801L, - 4816793278931948413L, - 1100877215282697461L, - -8016274804264066913L, - -7426166309912307238L, - 4954658046266531508L, - -4883068330523614006L, - 7317707222197692142L, - -132182832923876333L, - -8068825386408665062L, - 4223343479296349312L, - -8975167582022794209L, - 121044807630038334L, - -6383751162555570203L, - -8622829604115563764L, - -5344448720560932522L, - -5623514837754212750L, - 5730174855784677314L, - 3652462989937797830L, - 4478407032758117542L, - 2265833848570320784L, - 6271663588896592981L, - -8981268861954876981L, - 2199940822940402275L, - -3590335709696386659L, - -6646866007057749522L, - 933450190390074330L, - -1705940515687714841L, - 884927789464592510L, - 7732852775367821028L, - -1725008633709952850L, - 3394484383328726796L, - 6799292447107791901L, - 4773322126911057201L, - -8847524026119006559L, - 1601292087637309633L, - 9085231169106063244L, - -1810226490203477297L, - 3740885817651637744L, - -7385020022373289763L, - 2121348550441645292L, - -8934827205753906340L, - 2329866036041432354L, - -227251566650479794L, - 778635064663790602L, - -5472060023053535116L, - -321365152251518886L, - 3413015614360083800L, - 6854233750120825103L, - -8179957420127792439L, - 7639860843374003692L, - -3294365432579777001L, - 7552965644538813699L, - -6829073195148823177L, - -6544243814787582018L, - 3276872521860349837L, - 1262482336572979429L, - -6035485817914735217L, - 7123327863090630643L, - -1419575113783159041L, - 4628009131887144546L, - 2592000227149193793L, - -5446709712701171970L, - -4786623131259234045L, - -2209160773748122650L, - 8047313604406463713L, - 2928998992221512765L, - 8881744382098607154L, - 5910178969134356556L, - 2892684451843776864L, - -7070070413419488908L, - 1140959062136881244L, - -8078877408786009860L, - 5222805670098495052L, - 1324778166912833091L, - 7845644310752162054L, - 6958124637538105999L, - -1400888392648874523L, - 2109573135688128455L, - -7865948962736451119L, - 4676890351917403373L, - 3174741654796657218L, - 514620636603694596L, - -5843197233618027131L, - -8822533246164651619L, - 7073040785885419375L, - -2228372994944279357L, - -979163503523055821L, - -6159677857222198592L, - 8520855780725828084L, - 4467908031177966524L, - 4623181254618087867L, - -7383960780180519764L, - 239794897939583881L, - -2449501378631335133L, - -9114494545950113117L, - -8576114508943907464L, - 7504752277411331892L, - -7009950139050754470L, - -7202878339609803777L, - 3502505583014180224L, - 3951294951154157069L, - 7576089410756827288L, - -4992190452267503827L, - 3759298924972701902L, - 5361054523231489156L, - 211310386754363706L, - -6228856565314106146L, - 680474239388747542L, - 2183261167073018417L, - 3717345151222475163L, - 8772076500587548312L, - 4345221692547451466L, - 1138257226251182865L, - -2662436603566678639L, - -4926523876409822165L, - -3678204040905789269L, - 8860732609728455709L, - 6897346961138467370L, - -1338981596745710341L, - -8468953950219880235L, - 486233297899205409L, - 6673618507643695244L, - 1938737376496949348L, - 2507410887406001878L, - -3144439725476898055L, - -636790656650957308L, - 4344459600416585073L, - 8802289277757075229L, - -1379964110832028405L, - 3060435899170352150L, - -2801307070927302409L, - -7124182447926601667L, - -7426433529387563337L, - 7001977894058124773L, - 3831629918356470166L, - -7304530994934688959L, - 7754766126986449104L, - -46130394912060400L, - -8185025239564030663L, - -6956120752394147061L, - 4788947004304391335L, - -1735188894957188142L, - 9113463202794835297L, - 9061503384633795978L, - 3807163083218760203L, - -2329524236876369592L, - 8363142198304187431L, - 4935678682189220391L, - -6502593394044097632L, - 9064904356860480362L, - -2044134484905048187L, - 8567519794665060422L, - 3904525302336061297L, - -1494404137865570930L, - -5818134796948330499L, - 8916224465542753907L, - -6810040832909920013L, - 7300268571307893571L, - 8665822462022449768L, - -130646649469545334L, - 8931475468018250160L, - -2817889287241953373L, - -2752837956949520680L, - -1276654552752920573L, - -2251442540884890384L, - -839799567481138562L, - 2986595498063065529L, - 7592128662766254437L, - 5065431482109049471L, - 3052000465060381141L, - 8064475279897785235L, - 7316665605154791806L, - -7296124855087242119L, - -1068075826697136964L, - 1770213836059184427L, - 6802179540194069850L, - 5235498833141060330L, - -8408647861923123811L, - -8554824869230440474L, - 7743295190330547469L, - 6188344344114106969L, - 8228222936284833122L, - 3344247964190287149L, - 414458000971249569L, - -2223421794494123215L, - 119196072452533464L, - 1767473452281958193L, - 5414804141160961127L, - -6164986093592204309L, - -6945097172273522587L, - 7543678863267970809L, - 5972029304048115321L, - 7964352772558153769L, - -8031602489285468891L, - 4513387372558218399L, - -4317501704056493461L, - -274621052405989180L, - 7357459993975469423L, - -1045104405025437444L, - 8789089337669501295L, - -1542665393152510095L, - -5503352729676411061L, - 454066729485099003L, - -4605997634839849907L, - 7986133233466526795L, - 7797356799500954521L, - -9136756413477760050L, - -3352377497517747454L, - -7663557526205276831L, - -1525996382926367358L, - 6802076880476427490L, - -6954802694827637538L, - -8255048613760674037L, - -5526865146075990207L, - -8041208983843583602L, - -2876214926964143851L, - -4567575438614223896L, - 8420564950974772325L, - -4468508733028315993L, - 2158430745359670554L, - -5782727846185414792L, - -3874464451992878487L, - -8557153996715396413L, - -8661029592684774411L, - -4150741558733167704L, - 4770959381850533581L, - -1372013076694700751L, - 7324757985668456281L, - 5602798167879679886L, - 7096916745991890202L, - 3359546006805092444L, - -5934158002733550535L, - 3518079055124118324L, - 3891916644964858524L, - -784545090218957019L, - 8609087702173814141L, - -4214391733469045745L, - -2044858518039349251L, - -3293020846953619138L, - -7669901992597447071L, - -5672416569520217737L, - -3662648759277482540L, - 7169982674540677627L, - -5034338530874716914L, - -4364910862609957183L, - 7039463956727691070L, - 4376009824957522714L, - 313781735218274235L, - -8374050652661964404L, - 245866763156781213L, - 7728750319168662084L, - 594262726005822013L, - 7249071001552727284L, - 6347219246484821270L, - 6926202384981930971L, - 412730668885611257L, - 462335472710927109L, - -348263357460866746L, - 2609062719003263340L, - 1486600821422386160L, - 4132108509971674644L, - 8030540528138614735L, - 4390114767626197726L, - 910347911083267698L, - 4296150444361133712L, - 5908327276875316267L, - 6462269834278773298L, - 1022138366617103631L, - 5383154957747795010L, - 5699575167827705734L, - -2652265514146457472L, - 2238012648012330901L, - -5288285844452580653L, - -2216751023690323971L, - -1798254526639229052L, - 8315911965214904362L, - -563311534821832764L, - -1984298076611665046L, - 7341064198541676544L, - 3795556264919263871L, - -881121796727972887L, - -2490810657935140123L, - 6330994053097077495L, - 1735731862607083753L, - 1821412119760767989L, - -4980141494405310L, - -5081188792462627828L, - -968905527778495175L, - 8787413501897229149L, - 6443042663738607800L, - 3692053332344295218L, - -2382648731027216801L, - 5921028055250520509L, - -4441446372395233901L, - 8057250897470973794L, - -2179625882359143302L, - -4585983332243873847L, - 2947899043243289973L, - -3598625264816669494L, - 7399975594911733454L, - 8846907058100841405L, - 8603925306148488337L, - 8723738803991223798L, - 5322899334586289468L, - 980873212211856324L, - 1004635762793822977L, - -2140100049088182929L, - -3651897446664191337L, - -1874000194611339405L, - 583292569907066994L, - 1976990985958368945L, - -9218950396095831894L, - -3373076707808283751L, - -5833521315607870794L, - 3429301542190478141L, - -5779101479993755753L, - -3292515863222404618L, - -734356228269251634L, - -1419711834445978806L, - 4791895985462274442L, - 558659404424630665L, - 4275995064472140735L, - 7226750437651616111L, - 5615235292948993742L, - 4861367471360311948L, - 4049264481777356211L, - -1835014487079257912L, - 4979204155403334102L, - 1560749888033433035L, - 905000432154591788L, - 2652083709010751184L, - -434390227817650528L, - -3344931822017511339L, - -4822779910956367280L, - 5882026350853463756L, - 5891977867625769091L, - 2576050208155010377L, - -6619518348855378096L, - -5742844076219814181L, - -1914025252482891199L, - 5421866639996215069L, - 7835065614735292470L, - 6475952342457673167L, - 4955638233787312652L, - 1871081664582907788L, - -7245345286793459755L, - -3526808804006913310L, - 8344018619352798022L, - 5358291849312032011L, - -6703839318935180537L, - -6055000653146022613L, - -4547726197375295714L, - -2022691831043772930L, - 6905477133149069142L, - 5578750882894839351L, - -2144291497652708501L, - 4762703426605093736L, - -5891027977685165043L, - -4718456023150759710L, - 2043414443352475790L, - -4859905028662199142L, - -5557172942093408989L, - 4188007248401731314L, - -2942301800843817532L, - -7954850101179530301L, - 4495970396795510187L, - 6186348734301669790L, - -3001408455591637606L, - -8982053599214642216L, - 3206742202353249401L, - -313214205344900099L, - 4889646506758624956L, - -8388345116324930401L, - -7881544699619548038L, - 1635696647773999186L, - 7402207885754426706L, - 4891433307203901702L, - -4902077413549687845L, - -5143362415788346631L, - -4439682815321989946L, - -9042829490377265502L, - -4792104448908161508L, - -6627704780170319053L, - -5929099532414229375L, - -2106815749065875905L, - 7153802770224100626L, - 6823686413158082729L, - 1694613412884784670L, - -4006378366105720051L, - 3578159103226821407L, - -1734412197339646213L, - -7830870208911511566L, - -5772771500325183897L, - -6370961521433155442L, - -441749519334552646L, - 1412754462081697221L, - 8641432394145297452L, - -4975119815461720445L, - 3065463668829511567L, - -1417732062874945313L, - -8665490603267793267L, - 7087497419346604712L, - -1054219113545905941L, - -1315389530554573357L, - 7307121779722859187L, - 2145881449095507057L, - -1356311243412327435L, - -1586722954636622149L, - -2596336211110400075L, - -3215891778864924520L, - 2985606461750734808L, - 4692985241349436947L, - -7071521356811106236L, - 987506433534876222L, - 742743288878802279L, - -7582066902960079495L, - -2199576919602302097L, - -4292471260346290085L, - 7557016375506342717L, - -174092040409188492L, - 6491426317028063034L, - 8822682594036660801L, - 7173417784955207190L, - 8551647075273107302L, - -7644205156880731114L, - 2369403682692200990L, - -6106179001069207874L, - 4406129042862978293L, - -5294299708922784965L, - 4517194244669198236L, - 5935865739771554409L, - -148579357454083417L, - -5274315200034319889L, - -5097950017153595353L, - -3022334830850024229L, - -6777482830421353059L, - -2313967150562967720L, - -1391991890442893937L, - -868882361960329098L, - -4058598280032086693L, - -2072498290023372165L, - -2078524543685149712L, - -8995602191301155697L, - -9177698560918006329L, - -3896826154277082645L, - -4805811619774811701L, - 4704091919527581969L, - -8267745047895479775L, - 8851711941947232288L, - -7190173558292582252L, - 2840928875881838186L, - -4726327121612974966L, - 4739308903198773507L, - 3567219622550820947L, - 7071819841015279071L, - 1838081917409050236L, - 5764863108848455953L, - -4900908742261783725L, - -9214052328693993926L, - -3738104023508183695L, - 9075020475259263468L, - 2384031765345940148L, - -5444918603598131168L, - -2882755332293334170L, - -5876017912667903002L, - 1468518394398751688L, - -94624357829376694L, - 1502968325367457055L, - 3212228973304759982L, - -6076409951803744617L, - -689621575143754807L, - -7544663587107097008L, - -8464517018621156157L, - -9197647440671761342L, - -1138277308728785000L, - 7911450175654362014L, - -2846463762797468283L, - -5779655457569633261L, - 1229156604453014638L, - -5248062133487718488L, - 1945087454960389231L, - 2291489842271385397L, - 4548491699913654765L, - 4776530359090895890L, - -2392184633655107718L, - -1866462256049641298L, - 3379059210862389839L, - 1324602936428062030L, - 4537114827125131113L, - 952752288945823129L, - 3565038799689635380L, - -4943156879148090116L, - -620677278985252287L, - -5343479831206832325L, - -5942934304939405391L, - -7430408163129035969L, - -8536378671288512743L, - -630422435482211312L, - -4059263730309361295L, - 8362955714824710045L, - 6715535958794722463L, - -4944093219667507205L, - 4750238213300021794L, - -8834529272883383766L, - 928202066153864099L, - 4277678786869773289L, - 5803777088958198033L, - 2532770551571706676L, - 8937228681131524098L, - -4349917458712392154L, - 3600518091981945868L, - 3641253327732529861L, - 2269352593538301269L, - 269968982007354668L, - -9126734426165655944L, - 299251652927012593L, - -2622198051228209602L, - -8324653355422469245L, - -390691951434421313L, - -2377466392094607664L, - -7705538047856565009L, - 4335372426529707859L, - -2498731359403232390L, - 2813626900624072081L, - -4153400007749091122L, - 7328219555534666722L, - -7039010207561583485L, - -7451340093255351815L, - 8300978712927459521L, - 7991017147293573613L, - 7339614609177704490L, - -5125145048677445929L, - -1538654431949953813L, - -3305023236591253586L, - -6649451688833693508L, - -5820953574235680980L, - -912420997561859658L, - -3902860965130038472L, - -4703516784403936152L, - 3949690979346927322L, - -5528618711335454103L, - -2895138419635669572L, - 6284706264052186570L, - 3181053554338548547L, - 8917972201915064935L, - 75545390955492453L, - 6617851455758380376L, - -8707286283526343202L, - 6458946651764889185L, - 2987210920096501853L, - -3929693201880566946L, - -7311177148068531782L, - 4694554226910788398L, - -328680149836377578L, - -6188879516160944336L, - -1439844932334130992L, - 7708794174024674351L, - -4972006945073432467L, - -3162414061439364796L, - 7611809776816354031L, - 7254917564661254243L, - 3667622699015156399L, - -4913423608887015660L, - -6406987107635608389L, - 7035993050305636880L, - 1916243288799539554L, - -6879510021825536938L, - -2337637717379887008L, - 2467748304124499564L, - -3927108882927586500L, - -2369728608878680941L, - 342563431112818562L, - -5912585188049034482L, - -407795551560657970L, - -903691070858875362L, - -2971339966384799256L, - -650451997911266170L, - 5242710773034780732L, - -1758576207105628707L, - -1470978453124678938L, - 2028635970527834903L, - 6815510071666420375L, - -7234436760336244906L, - 6292192056464010286L, - 1442992781227112073L, - 741439802185251252L, - 8259834200418148233L, - -8169078357231916499L, - -1797363372045868164L, - -3466386712830748319L, - 553979734832180798L, - 2513380028887544649L, - 2661079907020837034L, - -5749043704832338332L, - -4746726654147920522L, - 4037149160512845688L, - 8783332493545543365L, - 6975966824887269880L, - 2414109369471474312L, - 5221641322938052740L, - 1045377610832006372L, - 8220190173269826766L, - -4267642609168870565L, - -6726832047984956997L, - 4915477332941388735L, - 6608423042031786987L, - 6581279335256275269L, - -1248042010437529483L, - 2938297630330955554L, - 4806385874000231762L, - -2426409043681964977L, - -3104809890914424604L, - 3239277469128944935L, - -3228874498793910978L, - -5342097497391211924L, - -5044251361276447963L, - 6207287572362362872L, - 6453529115456288086L, - -7761442273817439921L, - -1313531713770046715L, - 8881673399342129140L, - 4733296612672962576L, - -3473666608340546150L, - 8218487469845557336L, - 4700027778130567975L, - -5543249054637254074L, - -1139018312153423389L, - -2628885986060279174L, - -962753284069616419L, - -1977142032804526516L, - 6646177420565083192L, - 8016625832549598730L, - -1342495141337498297L, - 3211076661681150725L, - 7846691090184096603L, - -5609697763635391879L, - 2769843206190578001L, - -5672542928916786367L, - 4598226438051963770L, - -3227148609660772768L, - -3607859173825103520L, - 5670249508182208346L, - -6032039770208777467L, - 2614105956519160427L, - 5083815977140776067L, - -3296597605117180179L, - -7021640596217776934L, - 4650797426085619966L, - 6823311525616632062L, - 7318563146604289182L, - -3249092227795437062L, - -151150995477552393L, - 153136448819291758L, - 443418003145395916L, - 330893611106491728L, - -8176197849722920156L, - -5799839357743111551L, - 2867443686326337937L, - 5834608113617061904L, - -5527344088399014587L, - 1370666271993552626L, - -9013120144216259368L, - 1830815874448486738L, - -3091499273874627758L, - 2439461791078633880L, - -1604733478398884862L, - -2833138167354744622L, - -8845858068800398866L, - 3394332891858442031L, - 3777164890336719073L, - -2607231551899902562L, - 2739493825272673913L, - 6829159159418711593L, - -2509633811118610608L, - 4359413808008559480L, - 8154016792499406661L, - 1004971369233421951L, - -3608591463620078287L, - 4138095872882887017L, - -2603875175400857352L, - -8405872505069427520L, - 1602648447388078826L, - -8268213664821963029L, - -7851183899871800583L, - 7988099858367774014L, - 5236015171155823561L, - -7662486771050598416L, - -892959823376427763L, - -9172278347517696397L, - -3334552067210399222L, - 1963387851673972629L, - 366925093822958196L, - -8737871286507690286L, - -4059561536773198338L, - 5578357435587801257L, - -4737036380408504897L, - -2389650777043999775L, - 4340566577553274925L, - 87873442854751345L, - 4155340801507615439L, - -2055658632596291829L, - 6753511476349576327L, - 6452063849292950509L, - -1603688271352032940L, - 1697703077026901826L, - 5824711473055577279L, - 1379237507098137739L, - -1685127774222319703L, - -3439406616052314190L, - -1744663886940391594L, - -7216395177905133758L, - 8010452920400446284L, - 4766353280757415234L, - 5289169306825991429L, - 8447139631505072923L, - 321854408757186899L, - 3617266287300740708L, - -4787302239589324619L, - -4363130050517248733L, - 7132767988848188413L, - -5874421566019315237L, - -1493418467779572102L, - -1040767190340986459L, - -5719181448516381271L, - 945641378172265342L, - 4317786055883622899L, - -3043053328324478777L, - 7736235059159196619L, - 100300833538974478L, - -3101949869641724204L, - -5639485198324936982L, - -8593145909773483082L, - -7461619124932989195L, - 7184437998425110153L, - 2326528031076754258L, - 6398542587063881263L, - 5121771660090392362L, - 2305396835393933680L, - -1749007542647542275L, - -8460868976489643710L, - 2812416063972701080L, - 7906577727755007976L, - 6878465050504315500L, - -3674658411106758781L, - -1455749094773635190L + 0L, + -1498634010482895780L, + 6867524088326895660L, + 269206059098007870L, + -4886887581681798391L, + 3928433339794945779L, + 4316332308770427980L, + 2615655046588972881L, + 1900500844844731087L, + -937305021312369991L, + -8876585030919011822L, + -8568794208905766378L, + -7560937143015008723L, + 8498693544545256400L, + -2419449035530425220L, + 3329598615825088111L, + 1210853880152044769L, + 8924597104910535362L, + -3295737048979845383L, + -2077067637562286605L, + -1011034785208955521L, + -7140824109018505684L, + 1461819519553440317L, + 6436392319919688449L, + 9118839121464630705L, + -2917786468093466294L, + 504959295268162643L, + 6865609001872362604L, + 1331148763751586565L, + 5194938495997054762L, + 2665520052525504553L, + 276933320889118143L, + 4905118367340856460L, + 2074482748007873417L, + 33988220393155982L, + -1886632289327107396L, + 1961403923654424835L, + -2534868615627330587L, + 3462266467782463357L, + 7919120157912374187L, + -89126594710480197L, + -7042017916137112880L, + -7849604837443256405L, + 7183458575501572456L, + 5774439312980039315L, + -6565296715949686971L, + 8732951222530004068L, + 1900291206658974389L, + 7866927889483112715L, + 7328496947698938651L, + -8414002129273563525L, + -7507611883654277681L, + 1048916663450809742L, + 2886294206178088467L, + -8219721567024751529L, + 7725050882468238784L, + 3754847308658349557L, + -8413245846548203550L, + -3076479495605594465L, + -3121134529382168760L, + -8550177436169846333L, + -7635987039377529922L, + -5313723440094816160L, + -4177524123888580462L, + -1094315098609866806L, + 6577764665351221181L, + -7451684539960092493L, + 7061343558406187853L, + 871230336086645006L, + 6267395254690800101L, + 3141612453381470612L, + -8952205469861911532L, + 4767899395611465842L, + 7630515440353450329L, + -4985889236947520435L, + 4353614766406020339L, + 6903511086527962847L, + -4820634093847096378L, + 6452963341373240239L, + 8594720565063264398L, + -299303866433612643L, + 5948128939845193681L, + -6327319179549631842L, + 1661386658896970098L, + -387220913420000811L, + -9142963141159743830L, + -3957881162477548163L, + 7835579812652104509L, + -2179101728939025569L, + 1409259865195553628L, + 3329985067144149794L, + -4622006820323901246L, + -5489854929168527846L, + -4192684064311628792L, + -5930581590656743655L, + -8741322520672067800L, + -2532269067473596306L, + 2794660858881925622L, + -1660759460598522315L, + 4890293817527089205L, + 5011673154728255657L, + -2422404023490478452L, + -5823317675052947328L, + -1972153552478886407L, + 855875383009846790L, + 4539038924804919368L, + -3429781972296775524L, + -933120655172824074L, + 5340485644774899680L, + 1224352437979479512L, + -4247440279147522491L, + -2847066616858361472L, + 7303140713793758036L, + 177699726658531463L, + 7295117342573216781L, + -4960156472424071480L, + 8110395551125556627L, + 4814552517606903675L, + -5765636104388650769L, + -6413724172541333072L, + 8304733428601507939L, + 143869199545215598L, + -3363348007324106812L, + 778524423687782971L, + -3153748338449493859L, + 4072736150578731467L, + 2759867216020429817L, + 2328407206204809068L, + 3183594959296292673L, + 4716260652336579034L, + -2306094442378564227L, + 1612703725746980307L, + 9169273487926974528L, + 1221567220993136926L, + -1580158544177522978L, + -7978689145799920414L, + -8935536723451615449L, + -5386522443941349619L, + -2260007907190275450L, + -6109689112492865066L, + -7269857258080875354L, + 120767029125806560L, + 8179378742614718442L, + -1054596932535254740L, + -4819959080878920419L, + 6750654725339344085L, + 839742699455186248L, + 6590957420819328903L, + -8962195670723273636L, + 2970575532853857622L, + -2914121199343336253L, + -4719180678962776867L, + -3866803542764213986L, + 7340712279894103874L, + 665981095963825401L, + -7610703223561970702L, + -2285269148746390312L, + -7903336846335812333L, + 7602163920871488336L, + -2475707530835373762L, + 6488428233646685175L, + 781770467078860396L, + -1896921154761119070L, + 3650082028082002274L, + 1859676323486474137L, + -9056242232568275385L, + -1916274702525507105L, + -3359763315783254668L, + -6899438582509090070L, + -7391229595698815015L, + 7793799255007638001L, + -4654796168571058118L, + -9069457371238954514L, + -9079499580790007240L, + -2167538533996933224L, + -5375580275118212442L, + 1932479471587420530L, + 463274931357170593L, + -3434738247190694006L, + 8225681262889934868L, + 670972606916628978L, + -7016577201793262587L, + 9186141629236930525L, + -7494961908382494386L, + 6018069173542321620L, + 3178094810629815034L, + 4206446522733994268L, + -6087839594407260931L, + 3028792124204271051L, + -5992000926787926144L, + -6045285586180402268L, + -2566939030601076745L, + -6419778085488192839L, + -5937870815253811034L, + 3037623662402648617L, + 8475134681257527331L, + 7525467631675910914L, + -2155136652979576665L, + -8863297785379055796L, + -3708604617726301534L, + -1690991326769386459L, + -4914650490954752560L, + -3651000998051367684L, + 2310224359054007710L, + 6467643434506892008L, + -4675387411483580919L, + 1539479589290018260L, + -1317482399971130537L, + 4787089544028336616L, + -817342235353043974L, + 9005897661744065787L, + 1698757063019545437L, + -7450744880655832349L, + 941242980692041666L, + 3855717121175377711L, + 1838418961320954867L, + 7906600640157184104L, + 143774240320811355L, + -5033235558726049955L, + -3733441418159723230L, + 6322249537999722411L, + -3599749198660319070L, + 7881889296519703891L, + 8772851375938262713L, + -3694154014800677764L, + 5483806649985491869L, + 7467568598910778939L, + -839413141520398979L, + 1922118942992405635L, + 5178389178007203495L, + -2131625735310863702L, + -5210713408719608360L, + 969214743442701574L, + -6694519095627761288L, + -3987528749564960054L, + 6145126602437587352L, + -3312790047326848561L, + -5928158217897491190L, + -163692375920080658L, + -4638104573766795427L, + -8806888994476878747L, + -5569512305780637370L, + 1905174746960402451L, + -8994865683955938409L, + 6363190415094303315L, + -819892343899481166L, + 4997088889036354237L, + 7165251770996374856L, + 2252387190424353838L, + 3749847241214246299L, + 7255309255472237037L, + 4672295531818402039L, + -2560356144353793581L, + -2883403067265782436L, + 1079945501265719009L, + -4510676817588967577L, + 373333767776611969L, + -5012601232582215618L, + 2359976143593903713L, + -219011861965226894L, + 76910311444724969L, + 2854997659137560722L, + -6663673552428958663L, + 1647372533507817437L, + -3677652995772257250L, + 1062322309494793766L, + 3997004911860361768L, + -6239801180306730115L, + 7679085503289673770L, + 1937634364969511157L, + 5848969401602626006L, + 6881011614306732306L, + -1181711090074996330L, + 9115958678061403357L, + -4697019334186712846L, + -7555505080733309776L, + 833987302221784302L, + 5435944218394230630L, + 6255423471362246568L, + -4754437678222079801L, + 4816793278931948413L, + 1100877215282697461L, + -8016274804264066913L, + -7426166309912307238L, + 4954658046266531508L, + -4883068330523614006L, + 7317707222197692142L, + -132182832923876333L, + -8068825386408665062L, + 4223343479296349312L, + -8975167582022794209L, + 121044807630038334L, + -6383751162555570203L, + -8622829604115563764L, + -5344448720560932522L, + -5623514837754212750L, + 5730174855784677314L, + 3652462989937797830L, + 4478407032758117542L, + 2265833848570320784L, + 6271663588896592981L, + -8981268861954876981L, + 2199940822940402275L, + -3590335709696386659L, + -6646866007057749522L, + 933450190390074330L, + -1705940515687714841L, + 884927789464592510L, + 7732852775367821028L, + -1725008633709952850L, + 3394484383328726796L, + 6799292447107791901L, + 4773322126911057201L, + -8847524026119006559L, + 1601292087637309633L, + 9085231169106063244L, + -1810226490203477297L, + 3740885817651637744L, + -7385020022373289763L, + 2121348550441645292L, + -8934827205753906340L, + 2329866036041432354L, + -227251566650479794L, + 778635064663790602L, + -5472060023053535116L, + -321365152251518886L, + 3413015614360083800L, + 6854233750120825103L, + -8179957420127792439L, + 7639860843374003692L, + -3294365432579777001L, + 7552965644538813699L, + -6829073195148823177L, + -6544243814787582018L, + 3276872521860349837L, + 1262482336572979429L, + -6035485817914735217L, + 7123327863090630643L, + -1419575113783159041L, + 4628009131887144546L, + 2592000227149193793L, + -5446709712701171970L, + -4786623131259234045L, + -2209160773748122650L, + 8047313604406463713L, + 2928998992221512765L, + 8881744382098607154L, + 5910178969134356556L, + 2892684451843776864L, + -7070070413419488908L, + 1140959062136881244L, + -8078877408786009860L, + 5222805670098495052L, + 1324778166912833091L, + 7845644310752162054L, + 6958124637538105999L, + -1400888392648874523L, + 2109573135688128455L, + -7865948962736451119L, + 4676890351917403373L, + 3174741654796657218L, + 514620636603694596L, + -5843197233618027131L, + -8822533246164651619L, + 7073040785885419375L, + -2228372994944279357L, + -979163503523055821L, + -6159677857222198592L, + 8520855780725828084L, + 4467908031177966524L, + 4623181254618087867L, + -7383960780180519764L, + 239794897939583881L, + -2449501378631335133L, + -9114494545950113117L, + -8576114508943907464L, + 7504752277411331892L, + -7009950139050754470L, + -7202878339609803777L, + 3502505583014180224L, + 3951294951154157069L, + 7576089410756827288L, + -4992190452267503827L, + 3759298924972701902L, + 5361054523231489156L, + 211310386754363706L, + -6228856565314106146L, + 680474239388747542L, + 2183261167073018417L, + 3717345151222475163L, + 8772076500587548312L, + 4345221692547451466L, + 1138257226251182865L, + -2662436603566678639L, + -4926523876409822165L, + -3678204040905789269L, + 8860732609728455709L, + 6897346961138467370L, + -1338981596745710341L, + -8468953950219880235L, + 486233297899205409L, + 6673618507643695244L, + 1938737376496949348L, + 2507410887406001878L, + -3144439725476898055L, + -636790656650957308L, + 4344459600416585073L, + 8802289277757075229L, + -1379964110832028405L, + 3060435899170352150L, + -2801307070927302409L, + -7124182447926601667L, + -7426433529387563337L, + 7001977894058124773L, + 3831629918356470166L, + -7304530994934688959L, + 7754766126986449104L, + -46130394912060400L, + -8185025239564030663L, + -6956120752394147061L, + 4788947004304391335L, + -1735188894957188142L, + 9113463202794835297L, + 9061503384633795978L, + 3807163083218760203L, + -2329524236876369592L, + 8363142198304187431L, + 4935678682189220391L, + -6502593394044097632L, + 9064904356860480362L, + -2044134484905048187L, + 8567519794665060422L, + 3904525302336061297L, + -1494404137865570930L, + -5818134796948330499L, + 8916224465542753907L, + -6810040832909920013L, + 7300268571307893571L, + 8665822462022449768L, + -130646649469545334L, + 8931475468018250160L, + -2817889287241953373L, + -2752837956949520680L, + -1276654552752920573L, + -2251442540884890384L, + -839799567481138562L, + 2986595498063065529L, + 7592128662766254437L, + 5065431482109049471L, + 3052000465060381141L, + 8064475279897785235L, + 7316665605154791806L, + -7296124855087242119L, + -1068075826697136964L, + 1770213836059184427L, + 6802179540194069850L, + 5235498833141060330L, + -8408647861923123811L, + -8554824869230440474L, + 7743295190330547469L, + 6188344344114106969L, + 8228222936284833122L, + 3344247964190287149L, + 414458000971249569L, + -2223421794494123215L, + 119196072452533464L, + 1767473452281958193L, + 5414804141160961127L, + -6164986093592204309L, + -6945097172273522587L, + 7543678863267970809L, + 5972029304048115321L, + 7964352772558153769L, + -8031602489285468891L, + 4513387372558218399L, + -4317501704056493461L, + -274621052405989180L, + 7357459993975469423L, + -1045104405025437444L, + 8789089337669501295L, + -1542665393152510095L, + -5503352729676411061L, + 454066729485099003L, + -4605997634839849907L, + 7986133233466526795L, + 7797356799500954521L, + -9136756413477760050L, + -3352377497517747454L, + -7663557526205276831L, + -1525996382926367358L, + 6802076880476427490L, + -6954802694827637538L, + -8255048613760674037L, + -5526865146075990207L, + -8041208983843583602L, + -2876214926964143851L, + -4567575438614223896L, + 8420564950974772325L, + -4468508733028315993L, + 2158430745359670554L, + -5782727846185414792L, + -3874464451992878487L, + -8557153996715396413L, + -8661029592684774411L, + -4150741558733167704L, + 4770959381850533581L, + -1372013076694700751L, + 7324757985668456281L, + 5602798167879679886L, + 7096916745991890202L, + 3359546006805092444L, + -5934158002733550535L, + 3518079055124118324L, + 3891916644964858524L, + -784545090218957019L, + 8609087702173814141L, + -4214391733469045745L, + -2044858518039349251L, + -3293020846953619138L, + -7669901992597447071L, + -5672416569520217737L, + -3662648759277482540L, + 7169982674540677627L, + -5034338530874716914L, + -4364910862609957183L, + 7039463956727691070L, + 4376009824957522714L, + 313781735218274235L, + -8374050652661964404L, + 245866763156781213L, + 7728750319168662084L, + 594262726005822013L, + 7249071001552727284L, + 6347219246484821270L, + 6926202384981930971L, + 412730668885611257L, + 462335472710927109L, + -348263357460866746L, + 2609062719003263340L, + 1486600821422386160L, + 4132108509971674644L, + 8030540528138614735L, + 4390114767626197726L, + 910347911083267698L, + 4296150444361133712L, + 5908327276875316267L, + 6462269834278773298L, + 1022138366617103631L, + 5383154957747795010L, + 5699575167827705734L, + -2652265514146457472L, + 2238012648012330901L, + -5288285844452580653L, + -2216751023690323971L, + -1798254526639229052L, + 8315911965214904362L, + -563311534821832764L, + -1984298076611665046L, + 7341064198541676544L, + 3795556264919263871L, + -881121796727972887L, + -2490810657935140123L, + 6330994053097077495L, + 1735731862607083753L, + 1821412119760767989L, + -4980141494405310L, + -5081188792462627828L, + -968905527778495175L, + 8787413501897229149L, + 6443042663738607800L, + 3692053332344295218L, + -2382648731027216801L, + 5921028055250520509L, + -4441446372395233901L, + 8057250897470973794L, + -2179625882359143302L, + -4585983332243873847L, + 2947899043243289973L, + -3598625264816669494L, + 7399975594911733454L, + 8846907058100841405L, + 8603925306148488337L, + 8723738803991223798L, + 5322899334586289468L, + 980873212211856324L, + 1004635762793822977L, + -2140100049088182929L, + -3651897446664191337L, + -1874000194611339405L, + 583292569907066994L, + 1976990985958368945L, + -9218950396095831894L, + -3373076707808283751L, + -5833521315607870794L, + 3429301542190478141L, + -5779101479993755753L, + -3292515863222404618L, + -734356228269251634L, + -1419711834445978806L, + 4791895985462274442L, + 558659404424630665L, + 4275995064472140735L, + 7226750437651616111L, + 5615235292948993742L, + 4861367471360311948L, + 4049264481777356211L, + -1835014487079257912L, + 4979204155403334102L, + 1560749888033433035L, + 905000432154591788L, + 2652083709010751184L, + -434390227817650528L, + -3344931822017511339L, + -4822779910956367280L, + 5882026350853463756L, + 5891977867625769091L, + 2576050208155010377L, + -6619518348855378096L, + -5742844076219814181L, + -1914025252482891199L, + 5421866639996215069L, + 7835065614735292470L, + 6475952342457673167L, + 4955638233787312652L, + 1871081664582907788L, + -7245345286793459755L, + -3526808804006913310L, + 8344018619352798022L, + 5358291849312032011L, + -6703839318935180537L, + -6055000653146022613L, + -4547726197375295714L, + -2022691831043772930L, + 6905477133149069142L, + 5578750882894839351L, + -2144291497652708501L, + 4762703426605093736L, + -5891027977685165043L, + -4718456023150759710L, + 2043414443352475790L, + -4859905028662199142L, + -5557172942093408989L, + 4188007248401731314L, + -2942301800843817532L, + -7954850101179530301L, + 4495970396795510187L, + 6186348734301669790L, + -3001408455591637606L, + -8982053599214642216L, + 3206742202353249401L, + -313214205344900099L, + 4889646506758624956L, + -8388345116324930401L, + -7881544699619548038L, + 1635696647773999186L, + 7402207885754426706L, + 4891433307203901702L, + -4902077413549687845L, + -5143362415788346631L, + -4439682815321989946L, + -9042829490377265502L, + -4792104448908161508L, + -6627704780170319053L, + -5929099532414229375L, + -2106815749065875905L, + 7153802770224100626L, + 6823686413158082729L, + 1694613412884784670L, + -4006378366105720051L, + 3578159103226821407L, + -1734412197339646213L, + -7830870208911511566L, + -5772771500325183897L, + -6370961521433155442L, + -441749519334552646L, + 1412754462081697221L, + 8641432394145297452L, + -4975119815461720445L, + 3065463668829511567L, + -1417732062874945313L, + -8665490603267793267L, + 7087497419346604712L, + -1054219113545905941L, + -1315389530554573357L, + 7307121779722859187L, + 2145881449095507057L, + -1356311243412327435L, + -1586722954636622149L, + -2596336211110400075L, + -3215891778864924520L, + 2985606461750734808L, + 4692985241349436947L, + -7071521356811106236L, + 987506433534876222L, + 742743288878802279L, + -7582066902960079495L, + -2199576919602302097L, + -4292471260346290085L, + 7557016375506342717L, + -174092040409188492L, + 6491426317028063034L, + 8822682594036660801L, + 7173417784955207190L, + 8551647075273107302L, + -7644205156880731114L, + 2369403682692200990L, + -6106179001069207874L, + 4406129042862978293L, + -5294299708922784965L, + 4517194244669198236L, + 5935865739771554409L, + -148579357454083417L, + -5274315200034319889L, + -5097950017153595353L, + -3022334830850024229L, + -6777482830421353059L, + -2313967150562967720L, + -1391991890442893937L, + -868882361960329098L, + -4058598280032086693L, + -2072498290023372165L, + -2078524543685149712L, + -8995602191301155697L, + -9177698560918006329L, + -3896826154277082645L, + -4805811619774811701L, + 4704091919527581969L, + -8267745047895479775L, + 8851711941947232288L, + -7190173558292582252L, + 2840928875881838186L, + -4726327121612974966L, + 4739308903198773507L, + 3567219622550820947L, + 7071819841015279071L, + 1838081917409050236L, + 5764863108848455953L, + -4900908742261783725L, + -9214052328693993926L, + -3738104023508183695L, + 9075020475259263468L, + 2384031765345940148L, + -5444918603598131168L, + -2882755332293334170L, + -5876017912667903002L, + 1468518394398751688L, + -94624357829376694L, + 1502968325367457055L, + 3212228973304759982L, + -6076409951803744617L, + -689621575143754807L, + -7544663587107097008L, + -8464517018621156157L, + -9197647440671761342L, + -1138277308728785000L, + 7911450175654362014L, + -2846463762797468283L, + -5779655457569633261L, + 1229156604453014638L, + -5248062133487718488L, + 1945087454960389231L, + 2291489842271385397L, + 4548491699913654765L, + 4776530359090895890L, + -2392184633655107718L, + -1866462256049641298L, + 3379059210862389839L, + 1324602936428062030L, + 4537114827125131113L, + 952752288945823129L, + 3565038799689635380L, + -4943156879148090116L, + -620677278985252287L, + -5343479831206832325L, + -5942934304939405391L, + -7430408163129035969L, + -8536378671288512743L, + -630422435482211312L, + -4059263730309361295L, + 8362955714824710045L, + 6715535958794722463L, + -4944093219667507205L, + 4750238213300021794L, + -8834529272883383766L, + 928202066153864099L, + 4277678786869773289L, + 5803777088958198033L, + 2532770551571706676L, + 8937228681131524098L, + -4349917458712392154L, + 3600518091981945868L, + 3641253327732529861L, + 2269352593538301269L, + 269968982007354668L, + -9126734426165655944L, + 299251652927012593L, + -2622198051228209602L, + -8324653355422469245L, + -390691951434421313L, + -2377466392094607664L, + -7705538047856565009L, + 4335372426529707859L, + -2498731359403232390L, + 2813626900624072081L, + -4153400007749091122L, + 7328219555534666722L, + -7039010207561583485L, + -7451340093255351815L, + 8300978712927459521L, + 7991017147293573613L, + 7339614609177704490L, + -5125145048677445929L, + -1538654431949953813L, + -3305023236591253586L, + -6649451688833693508L, + -5820953574235680980L, + -912420997561859658L, + -3902860965130038472L, + -4703516784403936152L, + 3949690979346927322L, + -5528618711335454103L, + -2895138419635669572L, + 6284706264052186570L, + 3181053554338548547L, + 8917972201915064935L, + 75545390955492453L, + 6617851455758380376L, + -8707286283526343202L, + 6458946651764889185L, + 2987210920096501853L, + -3929693201880566946L, + -7311177148068531782L, + 4694554226910788398L, + -328680149836377578L, + -6188879516160944336L, + -1439844932334130992L, + 7708794174024674351L, + -4972006945073432467L, + -3162414061439364796L, + 7611809776816354031L, + 7254917564661254243L, + 3667622699015156399L, + -4913423608887015660L, + -6406987107635608389L, + 7035993050305636880L, + 1916243288799539554L, + -6879510021825536938L, + -2337637717379887008L, + 2467748304124499564L, + -3927108882927586500L, + -2369728608878680941L, + 342563431112818562L, + -5912585188049034482L, + -407795551560657970L, + -903691070858875362L, + -2971339966384799256L, + -650451997911266170L, + 5242710773034780732L, + -1758576207105628707L, + -1470978453124678938L, + 2028635970527834903L, + 6815510071666420375L, + -7234436760336244906L, + 6292192056464010286L, + 1442992781227112073L, + 741439802185251252L, + 8259834200418148233L, + -8169078357231916499L, + -1797363372045868164L, + -3466386712830748319L, + 553979734832180798L, + 2513380028887544649L, + 2661079907020837034L, + -5749043704832338332L, + -4746726654147920522L, + 4037149160512845688L, + 8783332493545543365L, + 6975966824887269880L, + 2414109369471474312L, + 5221641322938052740L, + 1045377610832006372L, + 8220190173269826766L, + -4267642609168870565L, + -6726832047984956997L, + 4915477332941388735L, + 6608423042031786987L, + 6581279335256275269L, + -1248042010437529483L, + 2938297630330955554L, + 4806385874000231762L, + -2426409043681964977L, + -3104809890914424604L, + 3239277469128944935L, + -3228874498793910978L, + -5342097497391211924L, + -5044251361276447963L, + 6207287572362362872L, + 6453529115456288086L, + -7761442273817439921L, + -1313531713770046715L, + 8881673399342129140L, + 4733296612672962576L, + -3473666608340546150L, + 8218487469845557336L, + 4700027778130567975L, + -5543249054637254074L, + -1139018312153423389L, + -2628885986060279174L, + -962753284069616419L, + -1977142032804526516L, + 6646177420565083192L, + 8016625832549598730L, + -1342495141337498297L, + 3211076661681150725L, + 7846691090184096603L, + -5609697763635391879L, + 2769843206190578001L, + -5672542928916786367L, + 4598226438051963770L, + -3227148609660772768L, + -3607859173825103520L, + 5670249508182208346L, + -6032039770208777467L, + 2614105956519160427L, + 5083815977140776067L, + -3296597605117180179L, + -7021640596217776934L, + 4650797426085619966L, + 6823311525616632062L, + 7318563146604289182L, + -3249092227795437062L, + -151150995477552393L, + 153136448819291758L, + 443418003145395916L, + 330893611106491728L, + -8176197849722920156L, + -5799839357743111551L, + 2867443686326337937L, + 5834608113617061904L, + -5527344088399014587L, + 1370666271993552626L, + -9013120144216259368L, + 1830815874448486738L, + -3091499273874627758L, + 2439461791078633880L, + -1604733478398884862L, + -2833138167354744622L, + -8845858068800398866L, + 3394332891858442031L, + 3777164890336719073L, + -2607231551899902562L, + 2739493825272673913L, + 6829159159418711593L, + -2509633811118610608L, + 4359413808008559480L, + 8154016792499406661L, + 1004971369233421951L, + -3608591463620078287L, + 4138095872882887017L, + -2603875175400857352L, + -8405872505069427520L, + 1602648447388078826L, + -8268213664821963029L, + -7851183899871800583L, + 7988099858367774014L, + 5236015171155823561L, + -7662486771050598416L, + -892959823376427763L, + -9172278347517696397L, + -3334552067210399222L, + 1963387851673972629L, + 366925093822958196L, + -8737871286507690286L, + -4059561536773198338L, + 5578357435587801257L, + -4737036380408504897L, + -2389650777043999775L, + 4340566577553274925L, + 87873442854751345L, + 4155340801507615439L, + -2055658632596291829L, + 6753511476349576327L, + 6452063849292950509L, + -1603688271352032940L, + 1697703077026901826L, + 5824711473055577279L, + 1379237507098137739L, + -1685127774222319703L, + -3439406616052314190L, + -1744663886940391594L, + -7216395177905133758L, + 8010452920400446284L, + 4766353280757415234L, + 5289169306825991429L, + 8447139631505072923L, + 321854408757186899L, + 3617266287300740708L, + -4787302239589324619L, + -4363130050517248733L, + 7132767988848188413L, + -5874421566019315237L, + -1493418467779572102L, + -1040767190340986459L, + -5719181448516381271L, + 945641378172265342L, + 4317786055883622899L, + -3043053328324478777L, + 7736235059159196619L, + 100300833538974478L, + -3101949869641724204L, + -5639485198324936982L, + -8593145909773483082L, + -7461619124932989195L, + 7184437998425110153L, + 2326528031076754258L, + 6398542587063881263L, + 5121771660090392362L, + 2305396835393933680L, + -1749007542647542275L, + -8460868976489643710L, + 2812416063972701080L, + 7906577727755007976L, + 6878465050504315500L, + -3674658411106758781L, + -1455749094773635190L }; private static final long[] HASHES_OF_LOOPING_BYTES_WITH_SEED_42 = { - 0L, - -5489459004343878315L, - 7503380622199085724L, - 2441079805732305625L, - 8819902077857493254L, - -7239504485102480291L, - -9103724217032567499L, - 7826741851900927935L, - 7861549010645900695L, - -4129502239425616770L, - 4078461785955388090L, - 1489179179228483555L, - -6880302114450925784L, - -1359221788845957867L, - 3262871501411962535L, - 33112984866957419L, - 100800524801407501L, - -3943434617574838336L, - -5567763290832289441L, - -6049917652519314692L, - 3409418409813158633L, - -2513363768495658276L, - 4729321061686624929L, - 5115271314646777786L, - -1775717939635903349L, - -8985310044214288169L, - -5289981668663347291L, - 2657445282762234064L, - 1658189325818139403L, - 7040959815147060996L, - -8236343544564189629L, - -6468423844022575750L, - -1734633079588783454L, - -8679472524235675133L, - 8623155328902958458L, - 8266452376374499416L, - -7986536660276263608L, - -38125844968838697L, - 3921548615006566009L, - 4167944986113577315L, - 7096373300544578406L, - -560467948694959375L, - -850973896622675114L, - 6041177228348470283L, - -7420438933559505984L, - -7157017808797228913L, - 9217073653386571039L, - -7925541759804601833L, - -4487790335997352328L, - 2187762356575143872L, - -5206697366103859618L, - 8288284347584621435L, - 6423483699864562311L, - -1301663738927719460L, - 5991822234757129975L, - 8484285492972108171L, - 311551427639324312L, - 8099673191736882495L, - 4653698799511358644L, - 4648482686787053407L, - -4597597110260670199L, - 1984036580098860995L, - 3448207916911718973L, - -2419012589431525517L, - 8388910627173913596L, - 189931510972302233L, - 3424055321741735739L, - -945841679237989100L, - 2168309080935198613L, - 3930831257313125476L, - 5077730010723338083L, - 5376103945202976111L, - 7108178613986510272L, - -9053383358889392039L, - -2078618651987341503L, - 8653340598805107048L, - 8828877028299898393L, - -8807324610935730640L, - -5999341882281512306L, - -4455338180650516077L, - -2009585294493958968L, - 7588673118342431490L, - -6389009730910810602L, - -8947948912760624317L, - -202446748676143218L, - -6162519566164064386L, - -4803722494667158367L, - -8605895565747471606L, - 5066687539085198609L, - 4310933084750715996L, - -4304304530429964114L, - 7737891570612803812L, - -3921768646472251957L, - -773766867734108857L, - 1818530881116628286L, - -9067673379583734262L, - -6823589291299652903L, - 776981371466262375L, - -4725670966108995L, - -8569242227636325585L, - 7909516787010450443L, - -5409862721314071515L, - 1913390982618688260L, - 6633081673493660503L, - -3605710376875214656L, - -8651943069220377447L, - -3425208691350179262L, - 2023446091470969965L, - -2468046963501962333L, - -8040451662076760690L, - 6158975019111504792L, - 6451542295099535005L, - 1802801579248303870L, - 2903003428319375652L, - 2834890810006302360L, - -6999968617065854757L, - -5369183269958550280L, - -6215225450449404642L, - -4073062335503587325L, - 456244319192879701L, - -24866508719391059L, - 743755516945687656L, - 7224143490658054462L, - -3977052728265338488L, - 6697206251899645381L, - -1994430781487194731L, - -212878833179631937L, - -3790446480600918357L, - -8511592301089770863L, - 1219524981576986810L, - 4205669984974194347L, - -9209991568622991160L, - -8128478767060283641L, - -2076540995963994161L, - -2831442865177886383L, - -1554323285239301165L, - 1155483303982507802L, - 5625007334328700567L, - 7506810827241318270L, - 4850815999417875788L, - -8326271238555403498L, - -3594934673556658753L, - 9130555384341207831L, - -1636079010828843126L, - -5064854279878768025L, - 6320681008229340321L, - -7870114218944117341L, - 459008888574399930L, - -9220264964593181895L, - 6941777480363861135L, - 1923797770202213346L, - -7993097353081304854L, - -7062721428278188440L, - 4641857350677613467L, - -1122321128205157978L, - -3526624090474535074L, - 4944983273040270843L, - 2063583183742948633L, - 3655700015999632472L, - -5913958156741267094L, - 8613461621342346429L, - 3728928562759850702L, - 6241947623237199216L, - 3774760249391115825L, - 6588067708543859113L, - -315068792768811173L, - -5773745174066109816L, - -3452596043397112080L, - 7177068584300707868L, - 4097817609960514365L, - -5523936337054287311L, - 5444453562100935555L, - 3539268898986090748L, - 7209639972437712982L, - 8208887215850721310L, - -7584003436803008027L, - -586284534101862111L, - -6581923378985929195L, - -1292149830675494156L, - 8697160487577903529L, - 5250575745761625176L, - 8289951302281058324L, - 9086201969492098206L, - -9184690972075930116L, - -2558748134131757348L, - -9201085943428059583L, - -1203051916666479257L, - 1834444962634487203L, - 3751251954263485890L, - -9131637525800107438L, - -8564897964388077031L, - -4014235661520374127L, - 7772145975456897696L, - 7355322558781294763L, - 1785796348137315143L, - -1810503426695106112L, - -7963306922570812555L, - 8368320991787406185L, - 7378068988124953771L, - 3490895360405304927L, - -2006181578179635491L, - -5275131505037815605L, - 6086715123177826637L, - 1009907222295997078L, - -189851063854443982L, - -7046763987694627132L, - 4056906261431690499L, - 4216346710909753402L, - 8183939407068939669L, - 2208727954886688050L, - -1634098797909572318L, - 540308152596731090L, - -1727304011169135128L, - -6242236677749002446L, - 6755106734652766002L, - 9202496665027870588L, - 3145991544544797692L, - -6269373509996933125L, - 4266947436916246907L, - -3398567844975915797L, - 8384588213561617608L, - 5989354874425809092L, - -153343096544690395L, - 9134497380995453092L, - -6788300148488988381L, - -1072244206525774929L, - 2731859015443790841L, - -3870727816981171328L, - 3166678867327320482L, - 1782381207784406192L, - 582296485367088592L, - 1924609876720457074L, - 2020031065269578886L, - 8699089776427025205L, - -8250138664796740621L, - -8999944208955163022L, - -7762984786287364139L, - -7261637070280909069L, - 8156604099628561139L, - 1927922010019336920L, - -1965484533023120730L, - -7378358867965860473L, - 6664442544791033212L, - 8081003240836167908L, - -4972927228442651371L, - 7037220157993345548L, - -4215239911770630248L, - -5424767419067785938L, - -5015387983382506291L, - 3753298110869126767L, - 8912454012440748855L, - 6246157925622615315L, - -4131608429474620379L, - -8866364110645726391L, - -4098704456672758799L, - 6667152953392950525L, - -2762608273732169437L, - 3667940640226771520L, - 5470356938562609842L, - 244296890800468507L, - 7856373341189773146L, - 3177289659856312500L, - 4580751320975678335L, - 5452034875875902693L, - -6459973872666569214L, - 8625227864473625727L, - -9052197575017583830L, - -7608813006404804371L, - 9124264055991041910L, - -4100497818513510737L, - 2980793238691227316L, - 6575852184122601786L, - 2996374119615737222L, - -5870513842846624786L, - -8762559588158401352L, - -6912312183162430280L, - -8032694211707482067L, - -4215194693068873060L, - -8105263246073793266L, - -8307710354093860627L, - -2478197063796008569L, - 6680336333415266706L, - -3911773407997852436L, - -7238133989410260247L, - 8137218262646498370L, - 7578266702219259398L, - 4984246736570911861L, - 5740916903194578939L, - 4650616964627618168L, - 930361122203084377L, - -6713840012306591264L, - -6351841364919936067L, - -2925823570763349733L, - 2325060427136132089L, - 5274176558463348026L, - -1818816163370336308L, - 4226120637281533162L, - -8207986865454475590L, - -6725133576876609787L, - -1600898310239203030L, - 1696982907642760280L, - 3217068829621413413L, - 5726899844622119885L, - -5334923571927126756L, - 2497036294033639132L, - 735344340727198341L, - -8578481740421909478L, - 5911424493524947756L, - -2237081032372483426L, - -1561034557541861451L, - -7693466035562951498L, - -8752739978025721151L, - -3280877235853016561L, - -335598525248223652L, - -8083858348383020986L, - 6627393503177414372L, - -3295140360722222876L, - 4582776009525319397L, - -5331509940479931877L, - 7726342923596696881L, - 5192783923588484563L, - 5568191868601892365L, - -4393837608149654125L, - 1618228693783883350L, - 1865907879575939327L, - -6187340976863502879L, - -7405067505368332090L, - 8443777486378865412L, - 310723497241167764L, - -5731861018710458545L, - -5188200524108388224L, - -5634297329175284953L, - -7899478064688965957L, - 7020598068122504891L, - -4174871225816409135L, - 7104858324370686207L, - 1001810694886929241L, - 4733684478957873906L, - 1798707327797267468L, - 752841691753555520L, - -3603149832862524798L, - 1130977238495142718L, - 6955284253225269412L, - 2247585991738722824L, - 5340594336749478221L, - 3633355463323711913L, - 8199061420280246379L, - -9034722840567119949L, - -490757115109600212L, - 7729314659586557941L, - -7671659041667731989L, - 8094072612753317160L, - -1759769045835117937L, - -6152365461952206160L, - 3606911680259234419L, - 6955318748746854408L, - -1011200841397882883L, - 5519324885444860877L, - 639515187583097557L, - -8137297682181162942L, - 2539677958872014602L, - 8313575916214347743L, - -7407936988953985656L, - 2917949547560244958L, - -4496138768486595800L, - -333949342684348960L, - -4317613540520387633L, - 3175626083058125320L, - 3148487542664978970L, - 739198439328606230L, - -198883737414807980L, - 8353961470331151973L, - 311945919273194245L, - -7052740176726980689L, - 5254438376261024030L, - -7550828065282849515L, - -34611043042402666L, - -9223367429051483136L, - -3370299527924413091L, - -3126722705768731979L, - -7163303945559650746L, - 6785247517465168600L, - -7406637645862089930L, - 3385765690609235233L, - -2811478167849833354L, - 867164096842195609L, - -4105629147992376513L, - 3062984161819352214L, - -9109105071124058400L, - 6860897610277413293L, - -188188174565377756L, - 7884790815752132293L, - 6738195176410269361L, - 4393541369181811113L, - -4968060783295630360L, - 1281959927064810831L, - 7544219152372891202L, - -3139356250465507412L, - -4662764301598305279L, - -5309739957670290877L, - -2335698040008447736L, - -5063258188578883170L, - -6060472572881319296L, - 8510043957998376964L, - 8054425688228121580L, - 467181640856973250L, - -8554733707863771098L, - 3945436629188897073L, - -4648027966578763700L, - 1436821870625146671L, - -6039021841572044396L, - -162916729795043698L, - 1387478937752001176L, - -5009376788980435331L, - -427324746652961365L, - 9045326031349144872L, - -6571167574055307665L, - -7420045062343802233L, - -8281911816922916681L, - 4447883374750578122L, - 8857646523249955246L, - -5267905974004184533L, - -6586019939801565413L, - 7267509981674277869L, - -1730011012540783294L, - -3361327884510257968L, - 3153991252302571831L, - -8310723694192823368L, - 7365064041171947240L, - -7013288395764077337L, - 4424660961017823126L, - 7969284775663103753L, - -4673682312621214884L, - 2388177300282901685L, - 6610519624906161503L, - 8382367186870347676L, - 8011820517530369081L, - -3416914590527734423L, - -4432873885847563136L, - -1241220595388288096L, - 3560316095147026509L, - -1797075113553514394L, - 6552677553429396356L, - 6246332708352927155L, - 3861438072358225949L, - -8565290136579594910L, - -8002406576632498243L, - -6412781196438208222L, - -9047876088717010136L, - -8568000574169975921L, - 5244941923904200088L, - 1628817165486138289L, - 5749777718311982230L, - -8611048104500552826L, - -6407884750949781504L, - -8282995989967171744L, - -6031458083272026720L, - -1472077105364514517L, - 4504451286765383015L, - -418652306528352371L, - -4257356316730897484L, - -2957389181041677312L, - -1145720335115263201L, - -3091972849220173524L, - 8005939599601764433L, - -3417016708987198366L, - -6247258224636787950L, - -472464393458793289L, - 1487875631970459019L, - 4893795040625314681L, - 2729581410182440515L, - -5405273280140448608L, - 1452154199208270257L, - 4883843472429258182L, - -8796762596319773668L, - -5429154805367510111L, - 4426909737432342245L, - 7056415113393668414L, - 8774883135212925637L, - 8450999418184998816L, - 3820763711897833468L, - 3300743371144621367L, - -1630173808856631543L, - -8553736113528269822L, - -1370002862968307889L, - 9214585244396484676L, - 1427686269336175185L, - -3598631782642855473L, - -5269185928615394541L, - 216499523242669211L, - 7102788753870316442L, - 5649046266779873829L, - -4035565318503894376L, - -1855507138875094206L, - -5459594227201815570L, - -7410474841354966828L, - 6975082282771211247L, - -6353323886182944803L, - 646100630104660099L, - 7745081824763595518L, - 1579836547749948481L, - 7479608073819635972L, - -988819659251472110L, - 3121457552118354542L, - 1867337923564303955L, - 9039210151448164075L, - -6005672592365502974L, - 6809724817190798332L, - -8247807826434556808L, - 8599378181039531724L, - -8714366537708795385L, - 6194756214969034120L, - 1931855937995972224L, - 7780282029507594520L, - 3768324591352426949L, - 4770908273445282121L, - -5412117564459724461L, - -6910299206138527089L, - -750571165687777551L, - -3467143436546008630L, - -8778968277750614352L, - 4618269006460421671L, - 3784770542544192149L, - -6555035917940220116L, - 8763137794052904168L, - 2160001599658800708L, - 6579628917216038693L, - 7486800118422365343L, - -4727709771709935935L, - 9187028796349560592L, - -7646323237657128497L, - -7748151792724558120L, - -6629529116619603711L, - -3614919661598905131L, - -8926765781889646711L, - 4895079662109541742L, - 2313039280851327331L, - 8353059951121245572L, - -4361790301612843227L, - 878233584623997873L, - -5808341064891365335L, - 4957901996955185469L, - 722227598467337170L, - -8083855043640093449L, - 6296815072878721220L, - 3074098970376702630L, - 6487949451261677276L, - -8230337956949714079L, - 1227684096490474594L, - 3317131110226161460L, - 2781726232095396341L, - -9035241125603661424L, - 1004655391950987227L, - 757196511985132878L, - -4972385379979135932L, - 377837633918307403L, - -1837164923183207790L, - -5200366587699061855L, - 5619426661630165722L, - 9149546739708634949L, - -2161224822270988047L, - -8498758122904002877L, - -1903606037752461125L, - 4004956335353186480L, - 5899754692366277712L, - -8569895455403315824L, - 951203285725380985L, - -724485898478246754L, - -2310191424936462146L, - -1054133327199042402L, - -4761860002343924045L, - 2144188224512375766L, - -8618252392915479178L, - 562427488463506661L, - 4069612511580576356L, - 2846217274335476972L, - -5321770005300190195L, - -2665939903796278305L, - -225615242036287371L, - 8340124049763317532L, - -39328151188901959L, - -7704128105896373508L, - -6608889722744029365L, - 6847177601802070732L, - 5406538445625075780L, - 6056004216550410553L, - -6388427415087871994L, - -8510724109624398612L, - 1448506476683617231L, - 7013188100856212082L, - -6841370342344231710L, - -7996960406936053822L, - 5644557457158245692L, - -3296152646650497129L, - 3536461329613452151L, - -437075207063513146L, - -2301050489557934983L, - 7033064488351122705L, - 3720571868910950941L, - -8581343467023390064L, - -4996282238270355618L, - -4434808715189273218L, - -405745463035508082L, - 277285441155208541L, - 3640603191696429655L, - -6364389291678904211L, - 9077697777962306790L, - -4001601843892243802L, - 4036732856234956705L, - 5248392274720098326L, - 1116847972047877816L, - 4922394575619327211L, - -6285322752897148435L, - 7067487638261530629L, - 3473525332456520606L, - 1575187083569040662L, - -7670017995359806441L, - -6787510510738894320L, - 2880618714956167265L, - -5120445290790388729L, - -1947917760777447734L, - -7623296073694422101L, - 3252361779690367994L, - -8216056055022359562L, - 7525264382031021147L, - 2009893625701158286L, - -3406258625692336241L, - -2113315207827000149L, - -915671322135664152L, - -682373916879109470L, - 1102410309220747041L, - -3371660099417710298L, - 1284384932118496184L, - -7899332066557362531L, - 6082326747969637807L, - 6505116014978799418L, - -6638025017400409848L, - 8709456587813780355L, - 1040637469205493394L, - 7527200228140193048L, - -8009477968838239749L, - -7823164037283850971L, - -219876523001630476L, - -848139362896608550L, - 1659572939496253703L, - 8161950828762262292L, - -5426744617505876369L, - -6207765518458666734L, - 1330209524194208987L, - 312506988145426657L, - -8129873431497496113L, - 2982679062731022510L, - -5042254163968603642L, - 7189511553154561296L, - -7590604770017947250L, - 120767234548166783L, - 3585968789169172934L, - 2487430371362637909L, - -2117477977959815963L, - 6421046597883904862L, - 1915941733899660405L, - 7900047779862894999L, - -7543931826611217049L, - -4916952521775291426L, - -2868801994144941951L, - 6651512411349747168L, - 5311738336671629395L, - 1306146344435585753L, - 2360381402797636290L, - -7691226452323755207L, - -7944284715220814174L, - -278406581618280958L, - 1353480834890980580L, - -649067407317035048L, - -3147933535381057618L, - 8567698068491364114L, - 2639644310821531916L, - -2152161395283566770L, - -4888814748855310545L, - -6303207358154211232L, - -5099131870614196461L, - 1424098929808643092L, - -7162716687949255953L, - 2211086469787899963L, - 2852072241831923863L, - 4450856661460487818L, - 1332130522000219486L, - 4147251563283461874L, - 1207043674339706873L, - 5443671922124706933L, - 1900093839190289799L, - 7347503945522504540L, - 731422176531392690L, - -6899700774889484649L, - 7348057852476419965L, - 4763308267257593468L, - 70257218879991846L, - -739514492116955951L, - 7591767932477900284L, - -7791579872430789094L, - -5400779832289360193L, - -5360582829574801216L, - 6569971639852448678L, - 6160828497878986046L, - -1727168098652705184L, - 2168846004878378381L, - 3297327696375153959L, - 6816148183875835322L, - 6384670180559749639L, - 5098012111875182199L, - -8698209070789796773L, - 7063131632249681588L, - -994727287627957439L, - -8454912490309479278L, - -1616686461984094239L, - 1344308255896663208L, - -8614195194739181643L, - 3663344734731025818L, - 1074555005632296286L, - -891663858889754871L, - 7659504325229552894L, - 7916780674786126372L, - 8131132452406873222L, - -8409366302969284111L, - -7706327771470710338L, - -6629724794338812712L, - 4368055399977230653L, - -7898426087691236094L, - -8547784929920600040L, - -3916622571725474306L, - -4989308590637893844L, - -4255097229406935303L, - -8312609963939033197L, - 6449019140953263140L, - 5157342915532938711L, - 2114971170894382906L, - -3301242078535642691L, - -8424713197061111009L, - -4112134632049136236L, - 6249939489475102785L, - -6545073932128498060L, - -7043982864808573077L, - 6372613537930878573L, - 3190762373477289654L, - -2561239600356400775L, - 5207465341857679769L, - -6030085238141555836L, - 1973763449748050094L, - -2775325371903939992L, - 5477072914568061968L, - -8020494920018725702L, - -6778226228458777374L, - -2143361845827059097L, - -322386110818436422L, - 8486418337526930389L, - 5809129796682159464L, - -229942269923625040L, - -2016398216082799086L, - 4390670686371535226L, - -2276539331110400014L, - 8774439736263797799L, - 2316161663149901044L, - -5179580561974546556L, - -2396133401944865178L, - 3993962098659830835L, - 5629462452797886102L, - -5192061905328685380L, - 5410941996746617173L, - -3413195609621963464L, - -3061527928424392689L, - -3054113352229014259L, - -6424671610054662331L, - 9078610721616192048L, - -8898368096446875621L, - -8847632839009160349L, - -2332831971225170476L, - 3877449624663826166L, - -1998707448586751868L, - 5429087783572068454L, - 7505803154815651797L, - -6830143293644567388L, - 9027942884466367570L, - -5480807710956981276L, - 6168732146645754047L, - 8449301918694745548L, - 8778131551317466896L, - -1532492605199755867L, - -5391910637120789750L, - -5181509335176571510L, - 4222261527096078209L, - -68830318451459248L, - 8424841595605316764L, - -1190497481446057488L, - -5111948271985560837L, - 6030679480752773280L, - 7083507386503347300L, - -7935292289390985767L, - 8633627957234765752L, - 3577142810841159035L, - -250643146821978960L, - -4509721932431137882L, - 1505984612542211946L, - -6225351760438749240L, - 2182044745474903681L, - 7360081805774852071L, - -6980851881719350610L, - 606607963933040411L, - -5770107456508471265L, - 6205171527781848205L, - -3033545694812095937L, - 3583699718972282357L, - -7909170363462215258L, - -7171285223522587462L, - -1732747624639492792L, - 1139035341695075787L, - -293770954049652554L, - 8082120553607704108L, - -1767102175355955963L, - 7028133695751489509L, - 8595468330969519695L, - -4137307279143322835L, - -1088171437960554838L, - -4259340386446889998L, - 21294966289363633L, - -591949962374694703L, - -8837800592081259554L, - 7601644682819323767L, - -982502680195313135L, - 4181853267649918079L, - -5294003730853637099L, - -9158462991451185546L, - 7714670871787985179L, - -2721092666693913595L, - -720896668009511516L, - 4921838985018879422L, - -5038198705157071079L, - 7630728150546004158L, - 161966667436904740L, - -6529489221033141970L, - -483227329696642903L, - 2849537400103054469L, - -5932420765747592953L, - 3979533979134217316L, - -4049239836784843381L, - 5757146880398784254L, - 5806736286865906304L, - -8474302415960396385L, - -7391831815026906062L, - 8483126874968724489L, - 5557012499729359067L, - 4450718684927895135L, - 45335272732612289L, - -3785965163879210184L, - -1898242962714602224L, - -3364618253842484328L, - 7668403852309119835L, - 2092013133434607977L, - -1792300051264582572L, - 4204792673868607151L, - 4506602674596874571L, - -2561418149393223402L, - 7840286404246905129L, - -1035302472383225621L, - 2052650440950159550L, - 3385198385403224840L, - 7801853565618136124L, - 8158750483397835365L, - -7255481277968854565L, - -9050796656268415729L, - 7872874903061363846L, - -6332810502682885990L, - 4195093936537787159L, - 4140384146136775979L, - -3176676578208440523L, - -23527475436056846L, - 4821243657012565340L, - 2886979330017289487L, - 7170512846071359835L, - -6693771254646812923L, - 2266839597848142710L, - 3688056798561584424L, - 7956035795239686169L, - 4088975310233216058L, - -8662929922277559505L, - 4700022330330092123L, - 1044087464966463501L, - -3346284225769510392L, - -1166910579445681945L, - 3872703144237011548L, - 8501175525170010672L, - -6207437985662953078L, - -8733361112153680184L, - -3983180467171621870L, - 2283374194446411819L, - -6768484891471740518L, - 8044328097415285480L, - 1443377185537854020L, - 6803666844639402915L, - 8720154422929864332L, - -2537061102409854144L, - -515858108659325765L, - -1158565680316859334L, - -663545770006278500L, - 5112621109506791791L, - -3092170124310912387L, - 7889395149687448634L, - 3388633789092670761L, - -4176247842082877688L, - 8523663650288415701L, - 8461829646589019728L, - 4476120923918733118L, - 4955138021944824086L, - -8201820083387949902L, - -5150243375844302061L, - -6574687189541337134L, - 1813511165037620728L, - -6609152628982158385L, - 8442952354678524497L, - -7676351795757159272L, - -8444140555968619192L, - -6601786601773499005L, - 2179080756673506193L, - -3666129723434408178L, - -6776769795366302107L, - 4171664079486791081L, - -5452069571377540094L, - 359346427326135662L, - 2943062004262958454L, - -3921968176415799286L, - -134281347921607697L, - -8484249901958594015L, - 2812222074991563409L, - 6633639557063290973L, - -592722373574704367L, - 3584411287925175652L, - 354153167171955028L, - 5447276746665911196L, - -8076348065615557008L, - 7731333241037517938L, - 3253442384900678998L, - -5522359985224379236L, - -6208482024641614158L, - -7364261433707360458L, - -5906718475206754288L, - -2204545928435159171L, - -2795996564005833532L, - 2349222489800990019L, - -2358167389589298636L, - -1617861920532466248L, - -5097493153019151553L, - 898922054995315500L, - 3869670625351897503L, - -6636810950712802069L, - 5490098271052481169L, - -6176774370284978063L, - 6938938509865848385L, - -4161311926638539187L, - 3014272433254839403L, - 9058504699799497601L, - 8524360852674201045L, - -740764664775712722L, - -5679661123465313250L, - -5211931178887212388L, - -7017041889364832492L, - -3265178850476174256L, - -1499900928604101474L, - -4067493147979900667L, - 7299368378152484612L, - -7198659177748600436L, - -2979171190660530337L, - -2762966740484030759L, - -7465049739128224935L, - 3612078396397763590L, - 266194042468197276L, - 5473972901094176230L, - 1189281358884994281L, - -1442205020880436346L, - 2879820564038232304L, - 43850317677405067L, - -4454333694153391476L, - 2645494799086526410L, - 3524717291729262494L, - -1894484565386325644L, - 4470670853232773914L, - 3053558524768124235L, - -6378696765233153672L, - 1358648698333278216L, - 8016007574038246972L, - 1967787619451912192L, - -7471676932864790027L, - 8977236026465107675L, - -2387834721762557666L, - 3231705025344572693L, - -4855075972961874506L, - -4885183281004063488L, - 8097441972752472290L, - -5620463229031782622L, - 7574868212737343521L, - 8681941269840717726L, - -3486423124456001000L, - 5744244643650494004L, - 1014205046998613439L, - -3068068226567078353L, - -6908549673521465879L, - -1963051143946794321L, - -7035572219116690072L, - 1540941112525663170L, - -6001520532777183018L, - -6097551378241760053L, - 2960057374064581400L, - 3321150298365188778L, - 6355960073926449062L, - -7405638803189110774L, - 3687349663678072492L, - 7457820208992039828L, - 4506866448636890209L, - -4654784871604524478L, - -6973401381709164081L, - 3047431536639897259L, - 3083474008161625734L, - 7390801469345280746L, - -8119102525062060290L, - -2941186586599229109L, - 6543095150723391014L, - 1289924509787893294L + 0L, + -5489459004343878315L, + 7503380622199085724L, + 2441079805732305625L, + 8819902077857493254L, + -7239504485102480291L, + -9103724217032567499L, + 7826741851900927935L, + 7861549010645900695L, + -4129502239425616770L, + 4078461785955388090L, + 1489179179228483555L, + -6880302114450925784L, + -1359221788845957867L, + 3262871501411962535L, + 33112984866957419L, + 100800524801407501L, + -3943434617574838336L, + -5567763290832289441L, + -6049917652519314692L, + 3409418409813158633L, + -2513363768495658276L, + 4729321061686624929L, + 5115271314646777786L, + -1775717939635903349L, + -8985310044214288169L, + -5289981668663347291L, + 2657445282762234064L, + 1658189325818139403L, + 7040959815147060996L, + -8236343544564189629L, + -6468423844022575750L, + -1734633079588783454L, + -8679472524235675133L, + 8623155328902958458L, + 8266452376374499416L, + -7986536660276263608L, + -38125844968838697L, + 3921548615006566009L, + 4167944986113577315L, + 7096373300544578406L, + -560467948694959375L, + -850973896622675114L, + 6041177228348470283L, + -7420438933559505984L, + -7157017808797228913L, + 9217073653386571039L, + -7925541759804601833L, + -4487790335997352328L, + 2187762356575143872L, + -5206697366103859618L, + 8288284347584621435L, + 6423483699864562311L, + -1301663738927719460L, + 5991822234757129975L, + 8484285492972108171L, + 311551427639324312L, + 8099673191736882495L, + 4653698799511358644L, + 4648482686787053407L, + -4597597110260670199L, + 1984036580098860995L, + 3448207916911718973L, + -2419012589431525517L, + 8388910627173913596L, + 189931510972302233L, + 3424055321741735739L, + -945841679237989100L, + 2168309080935198613L, + 3930831257313125476L, + 5077730010723338083L, + 5376103945202976111L, + 7108178613986510272L, + -9053383358889392039L, + -2078618651987341503L, + 8653340598805107048L, + 8828877028299898393L, + -8807324610935730640L, + -5999341882281512306L, + -4455338180650516077L, + -2009585294493958968L, + 7588673118342431490L, + -6389009730910810602L, + -8947948912760624317L, + -202446748676143218L, + -6162519566164064386L, + -4803722494667158367L, + -8605895565747471606L, + 5066687539085198609L, + 4310933084750715996L, + -4304304530429964114L, + 7737891570612803812L, + -3921768646472251957L, + -773766867734108857L, + 1818530881116628286L, + -9067673379583734262L, + -6823589291299652903L, + 776981371466262375L, + -4725670966108995L, + -8569242227636325585L, + 7909516787010450443L, + -5409862721314071515L, + 1913390982618688260L, + 6633081673493660503L, + -3605710376875214656L, + -8651943069220377447L, + -3425208691350179262L, + 2023446091470969965L, + -2468046963501962333L, + -8040451662076760690L, + 6158975019111504792L, + 6451542295099535005L, + 1802801579248303870L, + 2903003428319375652L, + 2834890810006302360L, + -6999968617065854757L, + -5369183269958550280L, + -6215225450449404642L, + -4073062335503587325L, + 456244319192879701L, + -24866508719391059L, + 743755516945687656L, + 7224143490658054462L, + -3977052728265338488L, + 6697206251899645381L, + -1994430781487194731L, + -212878833179631937L, + -3790446480600918357L, + -8511592301089770863L, + 1219524981576986810L, + 4205669984974194347L, + -9209991568622991160L, + -8128478767060283641L, + -2076540995963994161L, + -2831442865177886383L, + -1554323285239301165L, + 1155483303982507802L, + 5625007334328700567L, + 7506810827241318270L, + 4850815999417875788L, + -8326271238555403498L, + -3594934673556658753L, + 9130555384341207831L, + -1636079010828843126L, + -5064854279878768025L, + 6320681008229340321L, + -7870114218944117341L, + 459008888574399930L, + -9220264964593181895L, + 6941777480363861135L, + 1923797770202213346L, + -7993097353081304854L, + -7062721428278188440L, + 4641857350677613467L, + -1122321128205157978L, + -3526624090474535074L, + 4944983273040270843L, + 2063583183742948633L, + 3655700015999632472L, + -5913958156741267094L, + 8613461621342346429L, + 3728928562759850702L, + 6241947623237199216L, + 3774760249391115825L, + 6588067708543859113L, + -315068792768811173L, + -5773745174066109816L, + -3452596043397112080L, + 7177068584300707868L, + 4097817609960514365L, + -5523936337054287311L, + 5444453562100935555L, + 3539268898986090748L, + 7209639972437712982L, + 8208887215850721310L, + -7584003436803008027L, + -586284534101862111L, + -6581923378985929195L, + -1292149830675494156L, + 8697160487577903529L, + 5250575745761625176L, + 8289951302281058324L, + 9086201969492098206L, + -9184690972075930116L, + -2558748134131757348L, + -9201085943428059583L, + -1203051916666479257L, + 1834444962634487203L, + 3751251954263485890L, + -9131637525800107438L, + -8564897964388077031L, + -4014235661520374127L, + 7772145975456897696L, + 7355322558781294763L, + 1785796348137315143L, + -1810503426695106112L, + -7963306922570812555L, + 8368320991787406185L, + 7378068988124953771L, + 3490895360405304927L, + -2006181578179635491L, + -5275131505037815605L, + 6086715123177826637L, + 1009907222295997078L, + -189851063854443982L, + -7046763987694627132L, + 4056906261431690499L, + 4216346710909753402L, + 8183939407068939669L, + 2208727954886688050L, + -1634098797909572318L, + 540308152596731090L, + -1727304011169135128L, + -6242236677749002446L, + 6755106734652766002L, + 9202496665027870588L, + 3145991544544797692L, + -6269373509996933125L, + 4266947436916246907L, + -3398567844975915797L, + 8384588213561617608L, + 5989354874425809092L, + -153343096544690395L, + 9134497380995453092L, + -6788300148488988381L, + -1072244206525774929L, + 2731859015443790841L, + -3870727816981171328L, + 3166678867327320482L, + 1782381207784406192L, + 582296485367088592L, + 1924609876720457074L, + 2020031065269578886L, + 8699089776427025205L, + -8250138664796740621L, + -8999944208955163022L, + -7762984786287364139L, + -7261637070280909069L, + 8156604099628561139L, + 1927922010019336920L, + -1965484533023120730L, + -7378358867965860473L, + 6664442544791033212L, + 8081003240836167908L, + -4972927228442651371L, + 7037220157993345548L, + -4215239911770630248L, + -5424767419067785938L, + -5015387983382506291L, + 3753298110869126767L, + 8912454012440748855L, + 6246157925622615315L, + -4131608429474620379L, + -8866364110645726391L, + -4098704456672758799L, + 6667152953392950525L, + -2762608273732169437L, + 3667940640226771520L, + 5470356938562609842L, + 244296890800468507L, + 7856373341189773146L, + 3177289659856312500L, + 4580751320975678335L, + 5452034875875902693L, + -6459973872666569214L, + 8625227864473625727L, + -9052197575017583830L, + -7608813006404804371L, + 9124264055991041910L, + -4100497818513510737L, + 2980793238691227316L, + 6575852184122601786L, + 2996374119615737222L, + -5870513842846624786L, + -8762559588158401352L, + -6912312183162430280L, + -8032694211707482067L, + -4215194693068873060L, + -8105263246073793266L, + -8307710354093860627L, + -2478197063796008569L, + 6680336333415266706L, + -3911773407997852436L, + -7238133989410260247L, + 8137218262646498370L, + 7578266702219259398L, + 4984246736570911861L, + 5740916903194578939L, + 4650616964627618168L, + 930361122203084377L, + -6713840012306591264L, + -6351841364919936067L, + -2925823570763349733L, + 2325060427136132089L, + 5274176558463348026L, + -1818816163370336308L, + 4226120637281533162L, + -8207986865454475590L, + -6725133576876609787L, + -1600898310239203030L, + 1696982907642760280L, + 3217068829621413413L, + 5726899844622119885L, + -5334923571927126756L, + 2497036294033639132L, + 735344340727198341L, + -8578481740421909478L, + 5911424493524947756L, + -2237081032372483426L, + -1561034557541861451L, + -7693466035562951498L, + -8752739978025721151L, + -3280877235853016561L, + -335598525248223652L, + -8083858348383020986L, + 6627393503177414372L, + -3295140360722222876L, + 4582776009525319397L, + -5331509940479931877L, + 7726342923596696881L, + 5192783923588484563L, + 5568191868601892365L, + -4393837608149654125L, + 1618228693783883350L, + 1865907879575939327L, + -6187340976863502879L, + -7405067505368332090L, + 8443777486378865412L, + 310723497241167764L, + -5731861018710458545L, + -5188200524108388224L, + -5634297329175284953L, + -7899478064688965957L, + 7020598068122504891L, + -4174871225816409135L, + 7104858324370686207L, + 1001810694886929241L, + 4733684478957873906L, + 1798707327797267468L, + 752841691753555520L, + -3603149832862524798L, + 1130977238495142718L, + 6955284253225269412L, + 2247585991738722824L, + 5340594336749478221L, + 3633355463323711913L, + 8199061420280246379L, + -9034722840567119949L, + -490757115109600212L, + 7729314659586557941L, + -7671659041667731989L, + 8094072612753317160L, + -1759769045835117937L, + -6152365461952206160L, + 3606911680259234419L, + 6955318748746854408L, + -1011200841397882883L, + 5519324885444860877L, + 639515187583097557L, + -8137297682181162942L, + 2539677958872014602L, + 8313575916214347743L, + -7407936988953985656L, + 2917949547560244958L, + -4496138768486595800L, + -333949342684348960L, + -4317613540520387633L, + 3175626083058125320L, + 3148487542664978970L, + 739198439328606230L, + -198883737414807980L, + 8353961470331151973L, + 311945919273194245L, + -7052740176726980689L, + 5254438376261024030L, + -7550828065282849515L, + -34611043042402666L, + -9223367429051483136L, + -3370299527924413091L, + -3126722705768731979L, + -7163303945559650746L, + 6785247517465168600L, + -7406637645862089930L, + 3385765690609235233L, + -2811478167849833354L, + 867164096842195609L, + -4105629147992376513L, + 3062984161819352214L, + -9109105071124058400L, + 6860897610277413293L, + -188188174565377756L, + 7884790815752132293L, + 6738195176410269361L, + 4393541369181811113L, + -4968060783295630360L, + 1281959927064810831L, + 7544219152372891202L, + -3139356250465507412L, + -4662764301598305279L, + -5309739957670290877L, + -2335698040008447736L, + -5063258188578883170L, + -6060472572881319296L, + 8510043957998376964L, + 8054425688228121580L, + 467181640856973250L, + -8554733707863771098L, + 3945436629188897073L, + -4648027966578763700L, + 1436821870625146671L, + -6039021841572044396L, + -162916729795043698L, + 1387478937752001176L, + -5009376788980435331L, + -427324746652961365L, + 9045326031349144872L, + -6571167574055307665L, + -7420045062343802233L, + -8281911816922916681L, + 4447883374750578122L, + 8857646523249955246L, + -5267905974004184533L, + -6586019939801565413L, + 7267509981674277869L, + -1730011012540783294L, + -3361327884510257968L, + 3153991252302571831L, + -8310723694192823368L, + 7365064041171947240L, + -7013288395764077337L, + 4424660961017823126L, + 7969284775663103753L, + -4673682312621214884L, + 2388177300282901685L, + 6610519624906161503L, + 8382367186870347676L, + 8011820517530369081L, + -3416914590527734423L, + -4432873885847563136L, + -1241220595388288096L, + 3560316095147026509L, + -1797075113553514394L, + 6552677553429396356L, + 6246332708352927155L, + 3861438072358225949L, + -8565290136579594910L, + -8002406576632498243L, + -6412781196438208222L, + -9047876088717010136L, + -8568000574169975921L, + 5244941923904200088L, + 1628817165486138289L, + 5749777718311982230L, + -8611048104500552826L, + -6407884750949781504L, + -8282995989967171744L, + -6031458083272026720L, + -1472077105364514517L, + 4504451286765383015L, + -418652306528352371L, + -4257356316730897484L, + -2957389181041677312L, + -1145720335115263201L, + -3091972849220173524L, + 8005939599601764433L, + -3417016708987198366L, + -6247258224636787950L, + -472464393458793289L, + 1487875631970459019L, + 4893795040625314681L, + 2729581410182440515L, + -5405273280140448608L, + 1452154199208270257L, + 4883843472429258182L, + -8796762596319773668L, + -5429154805367510111L, + 4426909737432342245L, + 7056415113393668414L, + 8774883135212925637L, + 8450999418184998816L, + 3820763711897833468L, + 3300743371144621367L, + -1630173808856631543L, + -8553736113528269822L, + -1370002862968307889L, + 9214585244396484676L, + 1427686269336175185L, + -3598631782642855473L, + -5269185928615394541L, + 216499523242669211L, + 7102788753870316442L, + 5649046266779873829L, + -4035565318503894376L, + -1855507138875094206L, + -5459594227201815570L, + -7410474841354966828L, + 6975082282771211247L, + -6353323886182944803L, + 646100630104660099L, + 7745081824763595518L, + 1579836547749948481L, + 7479608073819635972L, + -988819659251472110L, + 3121457552118354542L, + 1867337923564303955L, + 9039210151448164075L, + -6005672592365502974L, + 6809724817190798332L, + -8247807826434556808L, + 8599378181039531724L, + -8714366537708795385L, + 6194756214969034120L, + 1931855937995972224L, + 7780282029507594520L, + 3768324591352426949L, + 4770908273445282121L, + -5412117564459724461L, + -6910299206138527089L, + -750571165687777551L, + -3467143436546008630L, + -8778968277750614352L, + 4618269006460421671L, + 3784770542544192149L, + -6555035917940220116L, + 8763137794052904168L, + 2160001599658800708L, + 6579628917216038693L, + 7486800118422365343L, + -4727709771709935935L, + 9187028796349560592L, + -7646323237657128497L, + -7748151792724558120L, + -6629529116619603711L, + -3614919661598905131L, + -8926765781889646711L, + 4895079662109541742L, + 2313039280851327331L, + 8353059951121245572L, + -4361790301612843227L, + 878233584623997873L, + -5808341064891365335L, + 4957901996955185469L, + 722227598467337170L, + -8083855043640093449L, + 6296815072878721220L, + 3074098970376702630L, + 6487949451261677276L, + -8230337956949714079L, + 1227684096490474594L, + 3317131110226161460L, + 2781726232095396341L, + -9035241125603661424L, + 1004655391950987227L, + 757196511985132878L, + -4972385379979135932L, + 377837633918307403L, + -1837164923183207790L, + -5200366587699061855L, + 5619426661630165722L, + 9149546739708634949L, + -2161224822270988047L, + -8498758122904002877L, + -1903606037752461125L, + 4004956335353186480L, + 5899754692366277712L, + -8569895455403315824L, + 951203285725380985L, + -724485898478246754L, + -2310191424936462146L, + -1054133327199042402L, + -4761860002343924045L, + 2144188224512375766L, + -8618252392915479178L, + 562427488463506661L, + 4069612511580576356L, + 2846217274335476972L, + -5321770005300190195L, + -2665939903796278305L, + -225615242036287371L, + 8340124049763317532L, + -39328151188901959L, + -7704128105896373508L, + -6608889722744029365L, + 6847177601802070732L, + 5406538445625075780L, + 6056004216550410553L, + -6388427415087871994L, + -8510724109624398612L, + 1448506476683617231L, + 7013188100856212082L, + -6841370342344231710L, + -7996960406936053822L, + 5644557457158245692L, + -3296152646650497129L, + 3536461329613452151L, + -437075207063513146L, + -2301050489557934983L, + 7033064488351122705L, + 3720571868910950941L, + -8581343467023390064L, + -4996282238270355618L, + -4434808715189273218L, + -405745463035508082L, + 277285441155208541L, + 3640603191696429655L, + -6364389291678904211L, + 9077697777962306790L, + -4001601843892243802L, + 4036732856234956705L, + 5248392274720098326L, + 1116847972047877816L, + 4922394575619327211L, + -6285322752897148435L, + 7067487638261530629L, + 3473525332456520606L, + 1575187083569040662L, + -7670017995359806441L, + -6787510510738894320L, + 2880618714956167265L, + -5120445290790388729L, + -1947917760777447734L, + -7623296073694422101L, + 3252361779690367994L, + -8216056055022359562L, + 7525264382031021147L, + 2009893625701158286L, + -3406258625692336241L, + -2113315207827000149L, + -915671322135664152L, + -682373916879109470L, + 1102410309220747041L, + -3371660099417710298L, + 1284384932118496184L, + -7899332066557362531L, + 6082326747969637807L, + 6505116014978799418L, + -6638025017400409848L, + 8709456587813780355L, + 1040637469205493394L, + 7527200228140193048L, + -8009477968838239749L, + -7823164037283850971L, + -219876523001630476L, + -848139362896608550L, + 1659572939496253703L, + 8161950828762262292L, + -5426744617505876369L, + -6207765518458666734L, + 1330209524194208987L, + 312506988145426657L, + -8129873431497496113L, + 2982679062731022510L, + -5042254163968603642L, + 7189511553154561296L, + -7590604770017947250L, + 120767234548166783L, + 3585968789169172934L, + 2487430371362637909L, + -2117477977959815963L, + 6421046597883904862L, + 1915941733899660405L, + 7900047779862894999L, + -7543931826611217049L, + -4916952521775291426L, + -2868801994144941951L, + 6651512411349747168L, + 5311738336671629395L, + 1306146344435585753L, + 2360381402797636290L, + -7691226452323755207L, + -7944284715220814174L, + -278406581618280958L, + 1353480834890980580L, + -649067407317035048L, + -3147933535381057618L, + 8567698068491364114L, + 2639644310821531916L, + -2152161395283566770L, + -4888814748855310545L, + -6303207358154211232L, + -5099131870614196461L, + 1424098929808643092L, + -7162716687949255953L, + 2211086469787899963L, + 2852072241831923863L, + 4450856661460487818L, + 1332130522000219486L, + 4147251563283461874L, + 1207043674339706873L, + 5443671922124706933L, + 1900093839190289799L, + 7347503945522504540L, + 731422176531392690L, + -6899700774889484649L, + 7348057852476419965L, + 4763308267257593468L, + 70257218879991846L, + -739514492116955951L, + 7591767932477900284L, + -7791579872430789094L, + -5400779832289360193L, + -5360582829574801216L, + 6569971639852448678L, + 6160828497878986046L, + -1727168098652705184L, + 2168846004878378381L, + 3297327696375153959L, + 6816148183875835322L, + 6384670180559749639L, + 5098012111875182199L, + -8698209070789796773L, + 7063131632249681588L, + -994727287627957439L, + -8454912490309479278L, + -1616686461984094239L, + 1344308255896663208L, + -8614195194739181643L, + 3663344734731025818L, + 1074555005632296286L, + -891663858889754871L, + 7659504325229552894L, + 7916780674786126372L, + 8131132452406873222L, + -8409366302969284111L, + -7706327771470710338L, + -6629724794338812712L, + 4368055399977230653L, + -7898426087691236094L, + -8547784929920600040L, + -3916622571725474306L, + -4989308590637893844L, + -4255097229406935303L, + -8312609963939033197L, + 6449019140953263140L, + 5157342915532938711L, + 2114971170894382906L, + -3301242078535642691L, + -8424713197061111009L, + -4112134632049136236L, + 6249939489475102785L, + -6545073932128498060L, + -7043982864808573077L, + 6372613537930878573L, + 3190762373477289654L, + -2561239600356400775L, + 5207465341857679769L, + -6030085238141555836L, + 1973763449748050094L, + -2775325371903939992L, + 5477072914568061968L, + -8020494920018725702L, + -6778226228458777374L, + -2143361845827059097L, + -322386110818436422L, + 8486418337526930389L, + 5809129796682159464L, + -229942269923625040L, + -2016398216082799086L, + 4390670686371535226L, + -2276539331110400014L, + 8774439736263797799L, + 2316161663149901044L, + -5179580561974546556L, + -2396133401944865178L, + 3993962098659830835L, + 5629462452797886102L, + -5192061905328685380L, + 5410941996746617173L, + -3413195609621963464L, + -3061527928424392689L, + -3054113352229014259L, + -6424671610054662331L, + 9078610721616192048L, + -8898368096446875621L, + -8847632839009160349L, + -2332831971225170476L, + 3877449624663826166L, + -1998707448586751868L, + 5429087783572068454L, + 7505803154815651797L, + -6830143293644567388L, + 9027942884466367570L, + -5480807710956981276L, + 6168732146645754047L, + 8449301918694745548L, + 8778131551317466896L, + -1532492605199755867L, + -5391910637120789750L, + -5181509335176571510L, + 4222261527096078209L, + -68830318451459248L, + 8424841595605316764L, + -1190497481446057488L, + -5111948271985560837L, + 6030679480752773280L, + 7083507386503347300L, + -7935292289390985767L, + 8633627957234765752L, + 3577142810841159035L, + -250643146821978960L, + -4509721932431137882L, + 1505984612542211946L, + -6225351760438749240L, + 2182044745474903681L, + 7360081805774852071L, + -6980851881719350610L, + 606607963933040411L, + -5770107456508471265L, + 6205171527781848205L, + -3033545694812095937L, + 3583699718972282357L, + -7909170363462215258L, + -7171285223522587462L, + -1732747624639492792L, + 1139035341695075787L, + -293770954049652554L, + 8082120553607704108L, + -1767102175355955963L, + 7028133695751489509L, + 8595468330969519695L, + -4137307279143322835L, + -1088171437960554838L, + -4259340386446889998L, + 21294966289363633L, + -591949962374694703L, + -8837800592081259554L, + 7601644682819323767L, + -982502680195313135L, + 4181853267649918079L, + -5294003730853637099L, + -9158462991451185546L, + 7714670871787985179L, + -2721092666693913595L, + -720896668009511516L, + 4921838985018879422L, + -5038198705157071079L, + 7630728150546004158L, + 161966667436904740L, + -6529489221033141970L, + -483227329696642903L, + 2849537400103054469L, + -5932420765747592953L, + 3979533979134217316L, + -4049239836784843381L, + 5757146880398784254L, + 5806736286865906304L, + -8474302415960396385L, + -7391831815026906062L, + 8483126874968724489L, + 5557012499729359067L, + 4450718684927895135L, + 45335272732612289L, + -3785965163879210184L, + -1898242962714602224L, + -3364618253842484328L, + 7668403852309119835L, + 2092013133434607977L, + -1792300051264582572L, + 4204792673868607151L, + 4506602674596874571L, + -2561418149393223402L, + 7840286404246905129L, + -1035302472383225621L, + 2052650440950159550L, + 3385198385403224840L, + 7801853565618136124L, + 8158750483397835365L, + -7255481277968854565L, + -9050796656268415729L, + 7872874903061363846L, + -6332810502682885990L, + 4195093936537787159L, + 4140384146136775979L, + -3176676578208440523L, + -23527475436056846L, + 4821243657012565340L, + 2886979330017289487L, + 7170512846071359835L, + -6693771254646812923L, + 2266839597848142710L, + 3688056798561584424L, + 7956035795239686169L, + 4088975310233216058L, + -8662929922277559505L, + 4700022330330092123L, + 1044087464966463501L, + -3346284225769510392L, + -1166910579445681945L, + 3872703144237011548L, + 8501175525170010672L, + -6207437985662953078L, + -8733361112153680184L, + -3983180467171621870L, + 2283374194446411819L, + -6768484891471740518L, + 8044328097415285480L, + 1443377185537854020L, + 6803666844639402915L, + 8720154422929864332L, + -2537061102409854144L, + -515858108659325765L, + -1158565680316859334L, + -663545770006278500L, + 5112621109506791791L, + -3092170124310912387L, + 7889395149687448634L, + 3388633789092670761L, + -4176247842082877688L, + 8523663650288415701L, + 8461829646589019728L, + 4476120923918733118L, + 4955138021944824086L, + -8201820083387949902L, + -5150243375844302061L, + -6574687189541337134L, + 1813511165037620728L, + -6609152628982158385L, + 8442952354678524497L, + -7676351795757159272L, + -8444140555968619192L, + -6601786601773499005L, + 2179080756673506193L, + -3666129723434408178L, + -6776769795366302107L, + 4171664079486791081L, + -5452069571377540094L, + 359346427326135662L, + 2943062004262958454L, + -3921968176415799286L, + -134281347921607697L, + -8484249901958594015L, + 2812222074991563409L, + 6633639557063290973L, + -592722373574704367L, + 3584411287925175652L, + 354153167171955028L, + 5447276746665911196L, + -8076348065615557008L, + 7731333241037517938L, + 3253442384900678998L, + -5522359985224379236L, + -6208482024641614158L, + -7364261433707360458L, + -5906718475206754288L, + -2204545928435159171L, + -2795996564005833532L, + 2349222489800990019L, + -2358167389589298636L, + -1617861920532466248L, + -5097493153019151553L, + 898922054995315500L, + 3869670625351897503L, + -6636810950712802069L, + 5490098271052481169L, + -6176774370284978063L, + 6938938509865848385L, + -4161311926638539187L, + 3014272433254839403L, + 9058504699799497601L, + 8524360852674201045L, + -740764664775712722L, + -5679661123465313250L, + -5211931178887212388L, + -7017041889364832492L, + -3265178850476174256L, + -1499900928604101474L, + -4067493147979900667L, + 7299368378152484612L, + -7198659177748600436L, + -2979171190660530337L, + -2762966740484030759L, + -7465049739128224935L, + 3612078396397763590L, + 266194042468197276L, + 5473972901094176230L, + 1189281358884994281L, + -1442205020880436346L, + 2879820564038232304L, + 43850317677405067L, + -4454333694153391476L, + 2645494799086526410L, + 3524717291729262494L, + -1894484565386325644L, + 4470670853232773914L, + 3053558524768124235L, + -6378696765233153672L, + 1358648698333278216L, + 8016007574038246972L, + 1967787619451912192L, + -7471676932864790027L, + 8977236026465107675L, + -2387834721762557666L, + 3231705025344572693L, + -4855075972961874506L, + -4885183281004063488L, + 8097441972752472290L, + -5620463229031782622L, + 7574868212737343521L, + 8681941269840717726L, + -3486423124456001000L, + 5744244643650494004L, + 1014205046998613439L, + -3068068226567078353L, + -6908549673521465879L, + -1963051143946794321L, + -7035572219116690072L, + 1540941112525663170L, + -6001520532777183018L, + -6097551378241760053L, + 2960057374064581400L, + 3321150298365188778L, + 6355960073926449062L, + -7405638803189110774L, + 3687349663678072492L, + 7457820208992039828L, + 4506866448636890209L, + -4654784871604524478L, + -6973401381709164081L, + 3047431536639897259L, + 3083474008161625734L, + 7390801469345280746L, + -8119102525062060290L, + -2941186586599229109L, + 6543095150723391014L, + 1289924509787893294L }; } diff --git a/src/test/java/net/openhft/hashing/XXH128Test.java b/src/test/java/net/openhft/hashing/XXH128Test.java index 7ddb48e..81e9fd4 100644 --- a/src/test/java/net/openhft/hashing/XXH128Test.java +++ b/src/test/java/net/openhft/hashing/XXH128Test.java @@ -10,15 +10,13 @@ import java.util.ArrayList; import java.util.Collection; -import static org.junit.Assert.assertEquals; - @RunWith(Parameterized.class) public class XXH128Test { @Parameterized.Parameters public static Collection data() { final int maxLen = Math.min(XXH128Test_HASHES.HASHES_OF_LOOPING_BYTES_WITHOUT_SEED.length, - XXH128Test_HASHES.HASHES_OF_LOOPING_BYTES_WITH_SEED_42.length); + XXH128Test_HASHES.HASHES_OF_LOOPING_BYTES_WITH_SEED_42.length); ArrayList data = new ArrayList(); for (int len = 0; len < maxLen; len++) { data.add(new Object[]{len}); @@ -48,6 +46,7 @@ private void test(LongTupleHashFunction h, LongHashFunction hl, long[][] hashesO LongHashFunctionTest.test(hl, data, hashesOfLoopingBytes[len][0]); } } + /** * Test data is output of the following program with xxh3 implementation * from https://github.com/Cyan4973/xxHash diff --git a/src/test/java/net/openhft/hashing/XXH3Test.java b/src/test/java/net/openhft/hashing/XXH3Test.java index fb8a540..ade180e 100644 --- a/src/test/java/net/openhft/hashing/XXH3Test.java +++ b/src/test/java/net/openhft/hashing/XXH3Test.java @@ -10,15 +10,13 @@ import java.util.ArrayList; import java.util.Collection; -import static org.junit.Assert.assertEquals; - @RunWith(Parameterized.class) public class XXH3Test { @Parameterized.Parameters public static Collection data() { final int maxLen = Math.min(XXH3Test_HASHES.HASHES_OF_LOOPING_BYTES_WITHOUT_SEED.length, - XXH3Test_HASHES.HASHES_OF_LOOPING_BYTES_WITH_SEED_42.length); + XXH3Test_HASHES.HASHES_OF_LOOPING_BYTES_WITH_SEED_42.length); ArrayList data = new ArrayList(); for (int len = 0; len < maxLen; len++) { data.add(new Object[]{len}); @@ -47,6 +45,7 @@ private void test(LongHashFunction h, long[] hashesOfLoopingBytes) { LongHashFunctionTest.test(h, data, hashesOfLoopingBytes[len]); } } + /** * Test data is output of the following program with xxh3 implementation * from https://github.com/Cyan4973/xxHash