diff --git a/README.adoc b/README.adoc new file mode 100644 index 00000000..d0c81289 --- /dev/null +++ b/README.adoc @@ -0,0 +1,10 @@ += Chronicle Algorithms +:toc: +:lang: en-GB + +Chronicle Algorithms delivers zero-allocation primitives for hashing, bit sets, raw-byte access, and lock-free coordination. +These building blocks underpin high-performance analytics and AI pipelines that require deterministic latency. + +== Documentation + +The legacy `README.md` provides a lightweight overview for scenarios where Markdown is required. diff --git a/pom.xml b/pom.xml index 5e95d32e..2b5198d4 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ net.openhft java-parent-pom 1.27ea1 - + chronicle-algorithms @@ -33,6 +33,18 @@ OpenHFT/Chronicle-Algorithms Chronicle-Algorithms + + 3.6.0 + 8.45.1 + 4.8.6.6 + 1.14.0 + 3.28.0 + 0.8.14 + 0.80 + 0.70 + 1.23ea6 + + @@ -172,4 +184,153 @@ master + + + code-review + + false + + + 0.0 + 0.0 + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.version} + + + com.puppycrawl.tools + checkstyle + ${puppycrawl.version} + + + net.openhft + chronicle-quality-rules + ${chronicle-quality-rules.version} + + + + + checkstyle + verify + + check + + + + + src/main/config/checkstyle.xml + true + true + warning + + + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.version} + + + com.h3xstream.findsecbugs + findsecbugs-plugin + ${findsecbugs.version} + + + + + spotbugs + verify + + check + + + + + Max + Low + true + src/main/config/spotbugs-exclude.xml + + + com.h3xstream.findsecbugs + findsecbugs-plugin + ${findsecbugs.version} + + + + + + org.apache.maven.plugins + maven-pmd-plugin + ${maven-pmd-plugin.version} + + + pmd + verify + + check + + + + + true + true + ${project.basedir}/src/main/config/pmd-exclude.properties + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + report + verify + + report + + + + check + verify + + check + + + + + BUNDLE + + + LINE + COVEREDRATIO + ${jacoco.line.coverage} + + + BRANCH + COVEREDRATIO + ${jacoco.branch.coverage} + + + + + + + + + + + + + diff --git a/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml new file mode 100644 index 00000000..844dd904 --- /dev/null +++ b/src/main/config/checkstyle.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/config/pmd-exclude.properties b/src/main/config/pmd-exclude.properties new file mode 100644 index 00000000..f8877474 --- /dev/null +++ b/src/main/config/pmd-exclude.properties @@ -0,0 +1 @@ +# Add Chronicle Algorithms PMD exclusions here using path=Rule1,Rule2 and include requirement IDs. diff --git a/src/main/config/spotbugs-exclude.xml b/src/main/config/spotbugs-exclude.xml new file mode 100644 index 00000000..993158c6 --- /dev/null +++ b/src/main/config/spotbugs-exclude.xml @@ -0,0 +1,45 @@ + + + + + + + + + Reusable container stores delegate references by design. + + + + + + Iterator wrapper must share frame-backed state. + + + + + + Singleton is immutable and intentionally shared. + + + + + + Strategy is stateless singleton shared safely. + + + + + + Strategy is stateless singleton shared safely. + + + + + + Tail mixing relies on switch fallthrough to pack remaining bytes. + + + diff --git a/src/main/java/net/openhft/chronicle/algo/MemoryUnit.java b/src/main/java/net/openhft/chronicle/algo/MemoryUnit.java index fef4d59b..fb01adbd 100644 --- a/src/main/java/net/openhft/chronicle/algo/MemoryUnit.java +++ b/src/main/java/net/openhft/chronicle/algo/MemoryUnit.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bitset/ConcurrentFlatBitSetFrame.java b/src/main/java/net/openhft/chronicle/algo/bitset/ConcurrentFlatBitSetFrame.java index 8d34948f..a4f421cf 100644 --- a/src/main/java/net/openhft/chronicle/algo/bitset/ConcurrentFlatBitSetFrame.java +++ b/src/main/java/net/openhft/chronicle/algo/bitset/ConcurrentFlatBitSetFrame.java @@ -16,13 +16,12 @@ package net.openhft.chronicle.algo.bitset; +import net.openhft.chronicle.algo.MemoryUnit; import net.openhft.chronicle.algo.bytes.Access; import net.openhft.chronicle.core.Jvm; import static java.lang.Long.numberOfLeadingZeros; import static java.lang.Long.numberOfTrailingZeros; -import static net.openhft.chronicle.algo.MemoryUnit.BITS; -import static net.openhft.chronicle.algo.MemoryUnit.LONGS; import static net.openhft.chronicle.algo.bitset.SingleThreadedFlatBitSetFrame.*; /** @@ -38,7 +37,7 @@ public final class ConcurrentFlatBitSetFrame implements BitSetFrame { * @param logicalSize the logical size in bits */ public ConcurrentFlatBitSetFrame(long logicalSize) { - longLength = BITS.toLongs(logicalSize); + longLength = MemoryUnit.BITS.toLongs(logicalSize); } /** @@ -100,7 +99,7 @@ private long readVolatileLong(Access access, T handle, long offset, long private boolean checkIndex(long bitIndex) { if (bitIndex < 0 || (bitIndex >> 6) >= longLength) { throw new IndexOutOfBoundsException( - "index: " + bitIndex + ", logical size: " + LONGS.toBits(longLength)); + "index: " + bitIndex + ", logical size: " + MemoryUnit.LONGS.toBits(longLength)); } return true; } @@ -117,14 +116,14 @@ private boolean checkFromTo(long fromIndex, long exclusiveToIndex, long toLongIn if (fromIndex < 0 || fromIndex > exclusiveToIndex || toLongIndex >= longLength) { throw new IndexOutOfBoundsException( "index range: [" + fromIndex + ", " + exclusiveToIndex + "), " + - "logical size: " + LONGS.toBits(longLength)); + "logical size: " + MemoryUnit.LONGS.toBits(longLength)); } return true; } @Override public void flip(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long byteIndex = firstByte(offset, longIndex); // only 6 lowest-order bits used, JLS 15.19 @@ -144,7 +143,7 @@ public void flipRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -205,7 +204,7 @@ public void flipRange(Access access, T handle, long offset, @Override public void set(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long byteIndex = firstByte(offset, longIndex); long mask = singleBit(bitIndex); @@ -222,7 +221,7 @@ public void set(Access access, T handle, long offset, long bitIndex) { @Override public boolean setIfClear(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long byteIndex = firstByte(offset, longIndex); long mask = singleBit(bitIndex); @@ -243,7 +242,7 @@ public void setRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -300,7 +299,7 @@ public void setAll(Access access, T handle, long offset) { @Override public void clear(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long byteIndex = firstByte(offset, longIndex); long mask = singleBit(bitIndex); @@ -317,7 +316,7 @@ public void clear(Access access, T handle, long offset, long bitIndex) { @Override public boolean clearIfSet(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long byteIndex = firstByte(offset, longIndex); long mask = singleBit(bitIndex); @@ -338,7 +337,7 @@ public void clearRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -388,15 +387,15 @@ public void clearRange(Access access, T handle, long offset, @Override public void clearAll(Access access, T handle, long offset) { // Clear all bits - access.writeBytes(handle, offset, LONGS.toBytes(longLength), (byte) 0); + access.writeBytes(handle, offset, MemoryUnit.LONGS.toBytes(longLength), (byte) 0); } @Override public boolean get(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long longIndex = longWithThisBit(bitIndex); long l = readVolatileLong(access, handle, offset, longIndex); - return (l & (singleBit(bitIndex))) != 0; // Check if the bit is set + return (l & singleBit(bitIndex)) != 0; // Check if the bit is set } @Override @@ -664,12 +663,12 @@ public long setPreviousClearBit(Access access, T handle, long offset, lon @Override public long logicalSize() { - return LONGS.toBits(longLength); // Return the logical size in bits + return MemoryUnit.LONGS.toBits(longLength); // Return the logical size in bits } @Override public long sizeInBytes() { - return LONGS.toBytes(longLength); // Return the size in bytes + return MemoryUnit.LONGS.toBytes(longLength); // Return the size in bytes } @Override @@ -1082,9 +1081,12 @@ public long next(Access access, T handle, long offset) { if (l != 0) { int trailingZeros = numberOfTrailingZeros(l); long index = bitIndex + trailingZeros; - if (((this.bitIndex = index + 1) & 63) == 0) { - if ((byteIndex = i + 8) == byteLength) - this.bitIndex = -1; + boolean aligned = ((this.bitIndex = index + 1) & 63) == 0; + if (aligned) { + byteIndex = i + 8; + } + if (aligned && byteIndex == byteLength) { + this.bitIndex = -1; } return index; } @@ -1092,11 +1094,10 @@ public long next(Access access, T handle, long offset) { if ((l = access.readLong(handle, i)) != 0) { int trailingZeros = numberOfTrailingZeros(l); long index = (i << 3) + trailingZeros; - if (((this.bitIndex = index + 1) & 63) != 0) { - byteIndex = i; - } else { - if ((byteIndex = i + 8) == lim) - this.bitIndex = -1; + boolean aligned = ((this.bitIndex = index + 1) & 63) == 0; + byteIndex = aligned ? i + 8 : i; + if (aligned && byteIndex == lim) { + this.bitIndex = -1; } return index; } diff --git a/src/main/java/net/openhft/chronicle/algo/bitset/ReusableBitSet.java b/src/main/java/net/openhft/chronicle/algo/bitset/ReusableBitSet.java index 991d1318..ffc9e63d 100644 --- a/src/main/java/net/openhft/chronicle/algo/bitset/ReusableBitSet.java +++ b/src/main/java/net/openhft/chronicle/algo/bitset/ReusableBitSet.java @@ -15,7 +15,6 @@ */ package net.openhft.chronicle.algo.bitset; - import net.openhft.chronicle.algo.bytes.Access; /** diff --git a/src/main/java/net/openhft/chronicle/algo/bitset/SingleThreadedFlatBitSetFrame.java b/src/main/java/net/openhft/chronicle/algo/bitset/SingleThreadedFlatBitSetFrame.java index 3526a8b8..9474c69b 100644 --- a/src/main/java/net/openhft/chronicle/algo/bitset/SingleThreadedFlatBitSetFrame.java +++ b/src/main/java/net/openhft/chronicle/algo/bitset/SingleThreadedFlatBitSetFrame.java @@ -114,7 +114,7 @@ static void checkFromIndex(long fromIndex) { } long byteWithThisBit(long offset, long bitIndex) { - return offset + ((bitIndex >> 6) << 3); + return firstByte(offset, longWithThisBit(bitIndex)); } private boolean checkIndex(long bitIndex) { @@ -154,7 +154,7 @@ private void writeLong(Access access, T handle, long offset, */ @Override public void flip(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); + checkIndex(bitIndex); long byteIndex = byteWithThisBit(offset, bitIndex); long mask = singleBit(bitIndex); long l = access.readLong(handle, byteIndex); @@ -179,7 +179,7 @@ public void flipRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -216,7 +216,7 @@ public void flipRange(Access access, T handle, long offset, @Override public void set(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); // Ensure the bit index is within bounds + checkIndex(bitIndex); // Ensure the bit index is within bounds long byteIndex = byteWithThisBit(offset, bitIndex); // Calculate the byte index for the bit long mask = singleBit(bitIndex); // Create a mask for the specific bit long l = access.readLong(handle, byteIndex); // Read the current value at the byte index @@ -238,7 +238,7 @@ public void set(Access access, T handle, long offset, long bitIndex) { */ @Override public boolean setIfClear(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); // Ensure the bit index is within bounds + checkIndex(bitIndex); // Ensure the bit index is within bounds long byteIndex = byteWithThisBit(offset, bitIndex); // Calculate the byte index for the bit long mask = singleBit(bitIndex); // Create a mask for the specific bit long l = access.readLong(handle, byteIndex); // Read the current value at the byte index @@ -266,7 +266,7 @@ public void setRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); // Calculate the long index for the start bit long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); // Calculate the long index for the end bit - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -327,7 +327,7 @@ public void setAll(Access access, T handle, long offset) { */ @Override public void clear(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); // Ensure the bit index is within bounds + checkIndex(bitIndex); // Ensure the bit index is within bounds long byteIndex = byteWithThisBit(offset, bitIndex); // Calculate the byte index for the bit long mask = singleBit(bitIndex); // Create a mask for the specific bit long l = access.readLong(handle, byteIndex); // Read the current value at the byte index @@ -349,7 +349,7 @@ public void clear(Access access, T handle, long offset, long bitIndex) { */ @Override public boolean clearIfSet(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); // Ensure the bit index is within bounds + checkIndex(bitIndex); // Ensure the bit index is within bounds long byteIndex = byteWithThisBit(offset, bitIndex); // Calculate the byte index for the bit long mask = singleBit(bitIndex); // Create a mask for the specific bit long l = access.readLong(handle, byteIndex); // Read the current value at the byte index @@ -377,7 +377,7 @@ public void clearRange(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); // Calculate the long index for the start bit long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); // Calculate the long index for the end bit - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -429,13 +429,13 @@ public boolean isRangeSet(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); // Calculate the long index for the start bit long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); // Calculate the long index for the end bit - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; if ((fromIndex & 63) != 0) { // Check bits in the first partial long long mask = higherBitsIncludingThis(fromIndex); - if ((~(readLong(access, handle, offset, fromLongIndex)) & mask) != 0L) + if ((~readLong(access, handle, offset, fromLongIndex) & mask) != 0L) return false; firstFullLongIndex++; } @@ -451,11 +451,11 @@ public boolean isRangeSet(Access access, T handle, long offset, return false; } long mask = lowerBitsIncludingThis(toIndex); - return ((~readLong(access, handle, offset, toLongIndex)) & mask) == 0L; + return (~readLong(access, handle, offset, toLongIndex) & mask) == 0L; } } else { // Check bits within a single long long mask = higherBitsIncludingThis(fromIndex) & lowerBitsIncludingThis(toIndex); - return ((~readLong(access, handle, offset, fromLongIndex)) & mask) == 0L; + return (~readLong(access, handle, offset, fromLongIndex) & mask) == 0L; } } @@ -476,7 +476,7 @@ public boolean isRangeClear(Access access, T handle, long offset, long fromLongIndex = longWithThisBit(fromIndex); // Calculate the long index for the start bit long toIndex = exclusiveToIndex - 1; long toLongIndex = longWithThisBit(toIndex); // Calculate the long index for the end bit - assert checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid + checkFromTo(fromIndex, exclusiveToIndex, toLongIndex); // Ensure the range is valid if (fromLongIndex != toLongIndex) { long firstFullLongIndex = fromLongIndex; @@ -531,10 +531,10 @@ public void clearAll(Access access, T handle, long offset) { */ @Override public boolean get(Access access, T handle, long offset, long bitIndex) { - assert checkIndex(bitIndex); // Ensure the bit index is within bounds + checkIndex(bitIndex); // Ensure the bit index is within bounds long byteIndex = byteWithThisBit(offset, bitIndex); // Calculate the byte index for the bit long l = access.readLong(handle, byteIndex); // Read the value at the byte index - return (l & (singleBit(bitIndex))) != 0; // Check if the specific bit is set + return (l & singleBit(bitIndex)) != 0; // Check if the specific bit is set } /** @@ -736,7 +736,7 @@ private long previousSetBit(Access access, T handle, long offset, long fromIndex, long inclusiveToIndex) { long fromLongIndex = longWithThisBit(fromIndex); // Calculate the long index for the start bit long toLongIndex = longWithThisBit(inclusiveToIndex); // Calculate the long index for the end bit - assert checkFromTo(inclusiveToIndex, fromIndex + 1, toLongIndex); // Ensure the range is valid + checkFromTo(inclusiveToIndex, fromIndex + 1, toLongIndex); // Ensure the range is valid if (fromLongIndex >= longLength) { fromLongIndex = longLength - 1; // Adjust the start index if out of bounds fromIndex = logicalSize() - 1; @@ -992,7 +992,7 @@ public long setNextNContinuousClearBits(Access access, T handle, long off int bitsFromSecondWordToSwitch = numberOfBits - bitsFromFirstWord; if (bitsFromSecondWordToSwitch > 0) { - long mask2 = (singleBit(bitsFromSecondWordToSwitch)) - 1; + long mask2 = singleBit(bitsFromSecondWordToSwitch) - 1; access.writeLong(handle, byteIndex2, w2 ^ mask2); } return bitIndex; @@ -1114,22 +1114,20 @@ public long clearNextNContinuousSetBits(Access access, T handle, long off l = w1; } // (2) - if ((l & 1) == 0) { - if (l != 0) { - int trailingZeros = numberOfTrailingZeros(l); - bitIndex += trailingZeros; - // (3) - if ((bitsFromFirstWord -= trailingZeros) <= 0) { - bitsFromFirstWord += 64; - continue; // long loop - } - l = (w1 >>> bitIndex) | (w2 << bitsFromFirstWord); - } else { - // all bits are zeros, skip a whole word, - // bitsFromFirstWord not changed - bitIndex += 64; + if ((l & 1) == 0 && l != 0) { + int trailingZeros = numberOfTrailingZeros(l); + bitIndex += trailingZeros; + // (3) + if ((bitsFromFirstWord -= trailingZeros) <= 0) { + bitsFromFirstWord += 64; continue; // long loop } + l = (w1 >>> bitIndex) | (w2 << bitsFromFirstWord); + } else if (l == 0) { + // all bits are zeros, skip a whole word, + // bitsFromFirstWord not changed + bitIndex += 64; + continue; // long loop } while (true) { if (((~l) & nTrailingOnes) == 0) { @@ -1138,7 +1136,7 @@ public long clearNextNContinuousSetBits(Access access, T handle, long off int bitsFromSecondWordToSwitch = numberOfBits - bitsFromFirstWord; if (bitsFromSecondWordToSwitch > 0) { - long mask2 = (singleBit(bitsFromSecondWordToSwitch)) - 1; + long mask2 = singleBit(bitsFromSecondWordToSwitch) - 1; access.writeLong(handle, byteIndex2, w2 ^ mask2); } return bitIndex; @@ -1461,14 +1459,14 @@ public long next(Access access, T handle, long offset) { long l; if ((l = currentWord) != 0) { int trailingZeros = numberOfTrailingZeros(l); - currentWord = (l >>> trailingZeros) >>> 1; + currentWord = l >>> trailingZeros >>> 1; return bitIndex += trailingZeros + 1; } for (long i = byteIndex, lim = byteLength; (i += 8) < lim; ) { if ((l = access.readLong(handle, i)) != 0) { byteIndex = i; int trailingZeros = numberOfTrailingZeros(l); - currentWord = (l >>> trailingZeros) >>> 1; + currentWord = l >>> trailingZeros >>> 1; return bitIndex = (i << 3) + trailingZeros; } } diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/Access.java b/src/main/java/net/openhft/chronicle/algo/bytes/Access.java index d7cff96d..c7a6ee1a 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/Access.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/Access.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/AccessCommon.java b/src/main/java/net/openhft/chronicle/algo/bytes/AccessCommon.java index b02f8a9d..a732dfa4 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/AccessCommon.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/AccessCommon.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/Accessor.java b/src/main/java/net/openhft/chronicle/algo/bytes/Accessor.java index 42de6dcd..041798fe 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/Accessor.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/Accessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/ArrayAccessors.java b/src/main/java/net/openhft/chronicle/algo/bytes/ArrayAccessors.java index a9b08de3..320a2e27 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/ArrayAccessors.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/ArrayAccessors.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccess.java b/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccess.java index 8bba2828..94d73cd1 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccess.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessor.java b/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessor.java index 2cb06a26..2dc379a2 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessor.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/BytesAccessors.java b/src/main/java/net/openhft/chronicle/algo/bytes/BytesAccessors.java index beeff4f3..9327d13e 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/BytesAccessors.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/BytesAccessors.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/CharSequenceAccessor.java b/src/main/java/net/openhft/chronicle/algo/bytes/CharSequenceAccessor.java index ac8e4845..a32242ea 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/CharSequenceAccessor.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/CharSequenceAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/RandomDataInputAccess.java b/src/main/java/net/openhft/chronicle/algo/bytes/RandomDataInputAccess.java index cc4d1e82..b578b272 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/RandomDataInputAccess.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/RandomDataInputAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/ReadAccess.java b/src/main/java/net/openhft/chronicle/algo/bytes/ReadAccess.java index a8367757..2bcb92c2 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/ReadAccess.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/ReadAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/WriteAccess.java b/src/main/java/net/openhft/chronicle/algo/bytes/WriteAccess.java index 88bd36a8..59fde093 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/WriteAccess.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/WriteAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/bytes/ZeroAccess.java b/src/main/java/net/openhft/chronicle/algo/bytes/ZeroAccess.java index 9e77a2c0..89046ba3 100644 --- a/src/main/java/net/openhft/chronicle/algo/bytes/ZeroAccess.java +++ b/src/main/java/net/openhft/chronicle/algo/bytes/ZeroAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/net/openhft/chronicle/algo/hashing/CityHash_1_1.java b/src/main/java/net/openhft/chronicle/algo/hashing/CityHash_1_1.java index 0898e77f..e2542ca5 100644 --- a/src/main/java/net/openhft/chronicle/algo/hashing/CityHash_1_1.java +++ b/src/main/java/net/openhft/chronicle/algo/hashing/CityHash_1_1.java @@ -18,6 +18,9 @@ import net.openhft.chronicle.algo.bytes.ReadAccess; +import java.io.IOException; +import java.io.ObjectInputStream; + import static java.lang.Long.reverseBytes; import static java.lang.Long.rotateRight; import static java.nio.ByteOrder.LITTLE_ENDIAN; @@ -32,10 +35,6 @@ class CityHash_1_1 { // Singleton instance of CityHash_1_1 private static final CityHash_1_1 INSTANCE = new CityHash_1_1(); - // Singleton instance with native byte order - private static final CityHash_1_1 NATIVE_CITY = NATIVE_LITTLE_ENDIAN ? - CityHash_1_1.INSTANCE : BigEndian.INSTANCE; - // Constants used in the hashing algorithm private static final long K0 = 0xc3a5c85c97cb3127L; private static final long K1 = 0xb492b66fbe98f273L; @@ -46,6 +45,10 @@ class CityHash_1_1 { private CityHash_1_1() { } + private static CityHash_1_1 nativeCity() { + return NATIVE_LITTLE_ENDIAN ? INSTANCE : BigEndian.INSTANCE; + } + /** * Applies a bitwise shift and mix operation to the given value. * @@ -441,20 +444,20 @@ private static class AsLongHashFunction extends LongHashFunction { private static final int SECOND_SHORT_BYTE_SHIFT = 8 - FIRST_SHORT_BYTE_SHIFT; private static final int SECOND_SHORT_BYTE_MASK = NATIVE_LITTLE_ENDIAN ? -1 : 0xFF; - private Object readResolve() { + protected Object readResolve() { return INSTANCE; } @Override public long hashLong(long input) { - input = NATIVE_CITY.toLittleEndian(input); + input = nativeCity().toLittleEndian(input); long hash = hash8To16Bytes(8L, input, input); return finalizeHash(hash); } @Override public long hashInt(int input) { - input = NATIVE_CITY.toLittleEndian(input); + input = nativeCity().toLittleEndian(input); long unsignedInt = Primitives.unsignedInt(input); long hash = hash4To7Bytes(4L, unsignedInt, unsignedInt); return finalizeHash(hash); @@ -509,7 +512,7 @@ private static class AsLongHashFunctionSeeded extends AsLongHashFunction { private static final long serialVersionUID = 0L; private final long seed0, seed1; - private final transient long voidHash; + private transient long voidHash; private AsLongHashFunctionSeeded(long seed0, long seed1) { this.seed0 = seed0; @@ -526,5 +529,14 @@ public long hashVoid() { protected final long finalizeHash(long hash) { return hashLen16(hash - seed0, seed1); } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + in.defaultReadObject(); + voidHash = finalizeHash(K2); + } + + protected Object readResolve() { + return new AsLongHashFunctionSeeded(seed0, seed1); + } } } diff --git a/src/main/java/net/openhft/chronicle/algo/hashing/MurmurHash_3.java b/src/main/java/net/openhft/chronicle/algo/hashing/MurmurHash_3.java index e86852b3..3e21ca15 100644 --- a/src/main/java/net/openhft/chronicle/algo/hashing/MurmurHash_3.java +++ b/src/main/java/net/openhft/chronicle/algo/hashing/MurmurHash_3.java @@ -15,9 +15,11 @@ */ package net.openhft.chronicle.algo.hashing; - import net.openhft.chronicle.algo.bytes.ReadAccess; +import java.io.IOException; +import java.io.ObjectInputStream; + import static java.lang.Long.reverseBytes; import static java.nio.ByteOrder.LITTLE_ENDIAN; import static net.openhft.chronicle.algo.hashing.LongHashFunction.NATIVE_LITTLE_ENDIAN; @@ -30,10 +32,6 @@ class MurmurHash_3 { // Singleton instance of MurmurHash_3 private static final MurmurHash_3 INSTANCE = new MurmurHash_3(); - // Singleton instance of MurmurHash_3 for native byte order - private static final MurmurHash_3 NATIVE_MURMUR = NATIVE_LITTLE_ENDIAN ? - MurmurHash_3.INSTANCE : BigEndian.INSTANCE; - // Constants used in the hash function private static final long C1 = 0x87c37b91114253d5L; private static final long C2 = 0x4cf5ad432745937fL; @@ -42,6 +40,10 @@ class MurmurHash_3 { private MurmurHash_3() { } + private static MurmurHash_3 nativeMurmur() { + return NATIVE_LITTLE_ENDIAN ? INSTANCE : BigEndian.INSTANCE; + } + /** * Finalizes the hash computation by mixing the hash values. * @@ -374,7 +376,7 @@ private static class AsLongHashFunction extends LongHashFunction { private static final long serialVersionUID = 0L; // Ensures singleton pattern after deserialization - private Object readResolve() { + protected Object readResolve() { return INSTANCE; } @@ -402,23 +404,23 @@ long hashNativeLong(long nativeLong, long len) { @Override public long hashLong(long input) { - return hashNativeLong(NATIVE_MURMUR.toLittleEndian(input), 8L); + return hashNativeLong(nativeMurmur().toLittleEndian(input), 8L); } @Override public long hashInt(int input) { - return hashNativeLong(Primitives.unsignedInt(NATIVE_MURMUR.toLittleEndian(input)), 4L); + return hashNativeLong(Primitives.unsignedInt(nativeMurmur().toLittleEndian(input)), 4L); } @Override public long hashShort(short input) { return hashNativeLong( - NATIVE_MURMUR.toLittleEndianShort(Primitives.unsignedShort(input)), 2L); + nativeMurmur().toLittleEndianShort(Primitives.unsignedShort(input)), 2L); } @Override public long hashChar(char input) { - return hashNativeLong(NATIVE_MURMUR.toLittleEndianShort(input), 2L); + return hashNativeLong(nativeMurmur().toLittleEndianShort(input), 2L); } @Override @@ -451,7 +453,7 @@ private static class AsLongHashFunctionSeeded extends AsLongHashFunction { // The seed value private final long seed; // The precomputed hash value for an empty input - private final transient long voidHash; + private transient long voidHash; /** * Constructs an instance with the given seed. @@ -480,5 +482,10 @@ long hashNativeLong(long nativeLong, long len) { public long hashVoid() { return voidHash; } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + in.defaultReadObject(); + voidHash = MurmurHash_3.finalize(0L, seed, seed); + } } } diff --git a/src/main/java/net/openhft/chronicle/algo/hashing/XxHash_r39.java b/src/main/java/net/openhft/chronicle/algo/hashing/XxHash_r39.java index 473a12d1..c4309ddb 100644 --- a/src/main/java/net/openhft/chronicle/algo/hashing/XxHash_r39.java +++ b/src/main/java/net/openhft/chronicle/algo/hashing/XxHash_r39.java @@ -29,9 +29,6 @@ */ class XxHash_r39 { private static final XxHash_r39 INSTANCE = new XxHash_r39(); - private static final XxHash_r39 NATIVE_XX = NATIVE_LITTLE_ENDIAN ? - XxHash_r39.INSTANCE : BigEndian.INSTANCE; - // Primes if treated as unsigned private static final long P1 = -7046029288634856825L; private static final long P2 = -4417276706812531889L; @@ -43,13 +40,17 @@ class XxHash_r39 { private XxHash_r39() { } + private static XxHash_r39 nativeXx() { + return NATIVE_LITTLE_ENDIAN ? INSTANCE : BigEndian.INSTANCE; + } + /** * Finalizes the hash value with additional mixing of bits. * * @param hash The initial hash value to finalize * @return The finalized hash value */ - private static long finalize(long hash) { + private static long finalizeHash(long hash) { hash ^= hash >>> 33; hash *= P2; hash ^= hash >>> 29; @@ -251,7 +252,7 @@ public long xxHash64(long seed, T input, ReadAccess access, long off, lon } // Finalize the hash value - return finalize(hash); + return finalizeHash(hash); } /** @@ -304,7 +305,7 @@ private static class AsLongHashFunction extends LongHashFunction { private static final long serialVersionUID = 0L; // Ensure a singleton instance upon deserialization - private Object readResolve() { + protected Object readResolve() { return SEEDLESS_INSTANCE; } @@ -320,36 +321,36 @@ public long seed() { @Override public long hashLong(long input) { // Convert input to little-endian and compute hash - input = NATIVE_XX.toLittleEndian(input); + input = nativeXx().toLittleEndian(input); long hash = seed() + P5 + 8; input *= P2; input = Long.rotateLeft(input, 31); input *= P1; hash ^= input; hash = Long.rotateLeft(hash, 27) * P1 + P4; - return XxHash_r39.finalize(hash); + return finalizeHash(hash); } @Override public long hashInt(int input) { // Convert input to little-endian and compute hash - input = NATIVE_XX.toLittleEndian(input); + input = nativeXx().toLittleEndian(input); long hash = seed() + P5 + 4; hash ^= Primitives.unsignedInt(input) * P1; hash = Long.rotateLeft(hash, 23) * P2 + P3; - return XxHash_r39.finalize(hash); + return finalizeHash(hash); } @Override public long hashShort(short input) { // Convert input to little-endian and compute hash - input = NATIVE_XX.toLittleEndian(input); + input = nativeXx().toLittleEndian(input); long hash = seed() + P5 + 2; hash ^= Primitives.unsignedByte(input) * P5; hash = Long.rotateLeft(hash, 11) * P1; hash ^= Primitives.unsignedByte(input >> 8) * P5; hash = Long.rotateLeft(hash, 11) * P1; - return XxHash_r39.finalize(hash); + return finalizeHash(hash); } @Override @@ -363,12 +364,12 @@ public long hashByte(byte input) { long hash = seed() + P5 + 1; hash ^= Primitives.unsignedByte(input) * P5; hash = Long.rotateLeft(hash, 11) * P1; - return XxHash_r39.finalize(hash); + return finalizeHash(hash); } @Override public long hashVoid() { - return XxHash_r39.finalize(P5); + return finalizeHash(P5); } @Override @@ -376,7 +377,7 @@ public long hash(T input, ReadAccess access, long off, long len) { // Compute hash based on byte order of the input long seed = seed(); if (access.byteOrder(input) == LITTLE_ENDIAN) { - return XxHash_r39.INSTANCE.xxHash64(seed, input, access, off, len); + return INSTANCE.xxHash64(seed, input, access, off, len); } else { return BigEndian.INSTANCE.xxHash64(seed, input, access, off, len); } @@ -398,7 +399,7 @@ private static class AsLongHashFunctionSeeded extends AsLongHashFunction { */ private AsLongHashFunctionSeeded(long seed) { this.seed = seed; - voidHash = XxHash_r39.finalize(seed + P5); + voidHash = finalizeHash(seed + P5); } @Override diff --git a/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteUpdateWithWaitsLockingStrategy.java b/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteUpdateWithWaitsLockingStrategy.java index 8aaea1cf..8b642e13 100644 --- a/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteUpdateWithWaitsLockingStrategy.java +++ b/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteUpdateWithWaitsLockingStrategy.java @@ -15,7 +15,6 @@ */ package net.openhft.chronicle.algo.locks; - import net.openhft.chronicle.algo.bytes.Access; import net.openhft.chronicle.algo.bytes.ReadAccess; diff --git a/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteWithWaitsLockingStrategy.java b/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteWithWaitsLockingStrategy.java index 0c6f5c34..c2c3a44f 100644 --- a/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteWithWaitsLockingStrategy.java +++ b/src/main/java/net/openhft/chronicle/algo/locks/VanillaReadWriteWithWaitsLockingStrategy.java @@ -15,7 +15,6 @@ */ package net.openhft.chronicle.algo.locks; - import net.openhft.chronicle.algo.bytes.Access; import net.openhft.chronicle.algo.bytes.ReadAccess; diff --git a/src/test/java/net/openhft/chronicle/algo/bitset/DirectBitSetTest.java b/src/test/java/net/openhft/chronicle/algo/bitset/DirectBitSetTest.java index 92cde0fc..843ac43e 100644 --- a/src/test/java/net/openhft/chronicle/algo/bitset/DirectBitSetTest.java +++ b/src/test/java/net/openhft/chronicle/algo/bitset/DirectBitSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessTest.java b/src/test/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessTest.java index fe059ef8..8a979f2c 100644 --- a/src/test/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessTest.java +++ b/src/test/java/net/openhft/chronicle/algo/bytes/ByteBufferAccessTest.java @@ -1,103 +1,64 @@ +/* + * Copyright 2014-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package net.openhft.chronicle.algo.bytes; -import junit.framework.TestCase; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.nio.ByteBuffer; import java.nio.ByteOrder; -public class ByteBufferAccessTest extends TestCase { - private ByteBufferAccess access; - private ByteBuffer buffer; - - @BeforeEach - public void setUp() { - access = ByteBufferAccess.INSTANCE; - buffer = ByteBuffer.allocate(64).order(ByteOrder.LITTLE_ENDIAN); - } - - @Test - public void testReadByte() { - buffer.put(0, (byte) 123); - assertEquals(123, access.readByte(buffer, 0)); - } - - @Test - public void testReadShort() { - buffer.putShort(0, (short) 12345); - assertEquals(12345, access.readShort(buffer, 0)); - } - - @Test - public void testReadChar() { - buffer.putChar(0, 'a'); - assertEquals('a', access.readChar(buffer, 0)); - } - - @Test - public void testReadInt() { - buffer.putInt(0, 123456789); - assertEquals(123456789, access.readInt(buffer, 0)); - } - - @Test - public void testReadLong() { - buffer.putLong(0, 1234567890123456789L); - assertEquals(1234567890123456789L, access.readLong(buffer, 0)); - } - - @Test - public void testReadFloat() { - buffer.putFloat(0, 12345.6789f); - assertEquals(12345.6789f, access.readFloat(buffer, 0), 0.0); - } - - @Test - public void testReadDouble() { - buffer.putDouble(0, 1234567890.123456789); - assertEquals(1234567890.123456789, access.readDouble(buffer, 0), 0.0); - } - - @Test - public void testWriteByte() { - access.writeByte(buffer, 0, (byte) 123); - assertEquals(123, buffer.get(0)); - } - - @Test - public void testWriteShort() { - access.writeShort(buffer, 0, (short) 12345); - assertEquals(12345, buffer.getShort(0)); - } +import static java.nio.ByteOrder.BIG_ENDIAN; +import static java.nio.ByteOrder.LITTLE_ENDIAN; +import static org.junit.jupiter.api.Assertions.assertEquals; - @Test - public void testWriteChar() { - access.writeChar(buffer, 0, 'a'); - assertEquals('a', buffer.getChar(0)); - } +public class ByteBufferAccessTest { - @Test - public void testWriteInt() { - access.writeInt(buffer, 0, 123456789); - assertEquals(123456789, buffer.getInt(0)); - } + private static final byte[] SAMPLE = { + (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, + (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0 + }; - @Test - public void testWriteLong() { - access.writeLong(buffer, 0, 1234567890123456789L); - assertEquals(1234567890123456789L, buffer.getLong(0)); - } + private final ByteBufferAccess access = ByteBufferAccess.INSTANCE; @Test - public void testWriteFloat() { - access.writeFloat(buffer, 0, 12345.6789f); - assertEquals(12345.6789f, buffer.getFloat(0), 0.0); + public void littleEndianAccessReadsExpectedValues() { + ByteBuffer buffer = ByteBuffer.wrap(SAMPLE).order(LITTLE_ENDIAN); + + assertEquals(ByteOrder.LITTLE_ENDIAN, access.byteOrder(buffer)); + assertEquals(0xF0DEBC9A78563412L, access.readLong(buffer, 0)); + assertEquals(0xF0DEBC9AL, access.readUnsignedInt(buffer, 4)); + assertEquals(0x78563412, access.readInt(buffer, 0)); + assertEquals(0xBC9A, access.readUnsignedShort(buffer, 4)); + assertEquals(0x5634, access.readShort(buffer, 1)); + assertEquals(0xDE, access.readUnsignedByte(buffer, 6)); + assertEquals(-68, access.readByte(buffer, 5)); } @Test - public void testWriteDouble() { - access.writeDouble(buffer, 0, 1234567890.123456789); - assertEquals(1234567890.123456789, buffer.getDouble(0), 0.0); + public void bigEndianAccessReadsExpectedValues() { + ByteBuffer buffer = ByteBuffer.wrap(SAMPLE).order(BIG_ENDIAN); + + assertEquals(ByteOrder.BIG_ENDIAN, access.byteOrder(buffer)); + assertEquals(0x123456789ABCDEF0L, access.readLong(buffer, 0)); + assertEquals(0x12345678L, access.readUnsignedInt(buffer, 0)); + assertEquals((int) 0x9ABCDEF0L, access.readInt(buffer, 4)); + assertEquals(0x5678, access.readUnsignedShort(buffer, 2)); + assertEquals(0x789A, access.readShort(buffer, 3)); + assertEquals(0x34, access.readUnsignedByte(buffer, 1)); + assertEquals(-102, access.readByte(buffer, 4)); } -} \ No newline at end of file +} diff --git a/src/test/java/net/openhft/chronicle/algo/bytes/NativeAccessTest.java b/src/test/java/net/openhft/chronicle/algo/bytes/NativeAccessTest.java new file mode 100644 index 00000000..b1ad36b6 --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/bytes/NativeAccessTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2014-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.chronicle.algo.bytes; + +import net.openhft.chronicle.core.Jvm; +import org.junit.jupiter.api.Test; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +import static org.junit.jupiter.api.Assertions.*; + +public class NativeAccessTest { + + private final Accessor.Full byteAccessor = Accessor.byteArrayAccessor(); + private final Access byteAccess = byteAccessor.access(); + + @Test + public void arrayAccessReturnsSameHandleInstances() { + NativeAccess unsafe = NativeAccess.instance(); + NativeAccess second = NativeAccess.instance(); + assertNotNull(unsafe); + assertEquals(unsafe, second); + } + + @Test + public void byteArrayReadsRespectNativeOrder() { + byte[] sample = { + (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, + (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0 + }; + ByteBuffer expected = ByteBuffer.wrap(sample).order(ByteOrder.nativeOrder()); + + long offset = byteAccessor.offset(sample, 0); + assertEquals(expected.getLong(0), byteAccess.readLong(sample, offset)); + assertEquals(expected.getInt(4), byteAccess.readInt(sample, offset + 4)); + assertEquals(expected.getShort(2), byteAccess.readShort(sample, offset + 2)); + assertEquals(expected.get(5), byteAccess.readByte(sample, offset + 5)); + assertEquals(Byte.toUnsignedInt(sample[6]), byteAccess.readUnsignedByte(sample, offset + 6)); + assertEquals(Short.toUnsignedInt(expected.getShort(4)), + byteAccess.readUnsignedShort(sample, offset + 4)); + assertEquals(Integer.toUnsignedLong(expected.getInt(0)), + byteAccess.readUnsignedInt(sample, offset)); + } + + @Test + public void unalignedReadsMatchNativeByteBuffer() { + byte[] padded = new byte[9]; + System.arraycopy(new byte[]{ + (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, + (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0 + }, 0, padded, 1, 8); + + ByteBuffer expected = ByteBuffer.wrap(padded).order(ByteOrder.nativeOrder()); + long offset = byteAccessor.offset(padded, 1); + assertEquals(expected.getLong(1), byteAccess.readLong(padded, offset)); + assertEquals(Integer.toUnsignedLong(expected.getInt(1)), + byteAccess.readUnsignedInt(padded, offset)); + } + + @Test + public void primitiveArrayAccessReadsValues() { + long[] longs = {0xFEDCBA9876543210L, 0x123456789ABCDEFL}; + Accessor.Full longAccessor = Accessor.longArrayAccessor(); + Access longAccess = longAccessor.access(); + assertEquals(longs[0], longAccess.readLong(longs, longAccessor.offset(longs, 0))); + assertEquals(longs[1], longAccess.readLong(longs, longAccessor.offset(longs, 1))); + + int[] ints = {0xCAFEBABE, 0xDEADBEEF}; + Accessor.Full intAccessor = Accessor.intArrayAccessor(); + Access intAccess = intAccessor.access(); + assertEquals(ints[0], intAccess.readInt(ints, intAccessor.offset(ints, 0))); + assertEquals(ints[1], intAccess.readInt(ints, intAccessor.offset(ints, 1))); + + short[] shorts = {(short) 0xBEEF, (short) 0xCAFE}; + Accessor.Full shortAccessor = Accessor.shortArrayAccessor(); + Access shortAccess = shortAccessor.access(); + assertEquals(shorts[0], shortAccess.readShort(shorts, shortAccessor.offset(shorts, 0))); + assertEquals(shorts[1], shortAccess.readShort(shorts, shortAccessor.offset(shorts, 1))); + + char[] chars = {(char) 0xF00D, (char) 0xBABE}; + Accessor.Full charAccessor = Accessor.charArrayAccessor(); + Access charAccess = charAccessor.access(); + assertEquals(chars[0], charAccess.readChar(chars, charAccessor.offset(chars, 0))); + assertEquals(chars[1], charAccess.readChar(chars, charAccessor.offset(chars, 1))); + } + + @Test + public void compareAndSwapLongSupportsArrayBases() { + long[] longs = {0L}; + Accessor.Full longAccessor = Accessor.longArrayAccessor(); + Access longAccess = longAccessor.access(); + long offset = longAccessor.offset(longs, 0); + assertEquals(0L, longAccess.readLong(longs, offset)); + longAccess.writeLong(longs, offset, 42L); + assertEquals(42L, longAccess.readLong(longs, offset)); + // A successful CAS should set the value to 64 + boolean swapped = longAccess.compareAndSwapLong(longs, offset, 42L, 64L); + assertTrue(swapped); + assertEquals(64L, longAccess.readLong(longs, offset)); + } + + @Test + public void readViaAccessInterfaceMatchesNativeOffset() { + byte[] data = loopingBytes(16); + long baseOffset = Jvm.arrayByteBaseOffset(); + assertEquals(byteAccess.readInt(data, baseOffset + 4), + ByteBuffer.wrap(data).order(ByteOrder.nativeOrder()).getInt(4)); + } + + private static byte[] loopingBytes(int len) { + byte[] data = new byte[len]; + for (int i = 0; i < len; i++) { + data[i] = (byte) i; + } + return data; + } +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/City64MoreTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/City64MoreTest.java index 9692228e..ae25d3ad 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/City64MoreTest.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/City64MoreTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/City64_1_1_Test.java b/src/test/java/net/openhft/chronicle/algo/hashing/City64_1_1_Test.java index a361c8e4..805c3739 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/City64_1_1_Test.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/City64_1_1_Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/CityHashRegressionTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/CityHashRegressionTest.java new file mode 100644 index 00000000..8dde890c --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/hashing/CityHashRegressionTest.java @@ -0,0 +1,56 @@ +package net.openhft.chronicle.algo.hashing; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +class CityHashRegressionTest { + + private static final long[] CITY_WITHOUT_SEEDS = loadVector( + "City64_1_1_Test.java", "HASHES_OF_LOOPING_BYTES_WITHOUT_SEEDS"); + private static final long[] CITY_WITH_SEEDS = loadVector( + "City64_1_1_Test.java", "HASHES_OF_LOOPING_BYTES_WITH_SEEDS_0_0"); + private static final int MAX_LEN = Math.min(CITY_WITHOUT_SEEDS.length, CITY_WITH_SEEDS.length) - 1; + + static IntStream lengths() { + return IntStream.rangeClosed(0, MAX_LEN); + } + + @ParameterizedTest(name = "unseeded len={0}") + @MethodSource("lengths") + void unseededVectorsMatchReference(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.city_1_1(), + data, + CITY_WITHOUT_SEEDS[len]); + } + + @ParameterizedTest(name = "seeded len={0}") + @MethodSource("lengths") + void seededZeroZeroVectorsMatchReference(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.city_1_1(0L, 0L), + data, + CITY_WITH_SEEDS[len]); + } + + private static long[] loadVector(String fileName, String arrayName) { + String content = ReferenceData.load(fileName); + Pattern pattern = Pattern.compile(arrayName + "\\s*=\\s*(?:new\\s+long\\s*\\[\\s*\\]\\s*)?\\{([^}]*)\\}", Pattern.DOTALL); + Matcher matcher = pattern.matcher(content); + if (!matcher.find()) { + throw new IllegalStateException("Array " + arrayName + " not found in " + fileName); + } + String body = matcher.group(1); + return Stream.of(body.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .map(s -> s.endsWith("L") ? s.substring(0, s.length() - 1) : s) + .mapToLong(Long::parseLong) + .toArray(); + } +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/HashSearcherMain.java b/src/test/java/net/openhft/chronicle/algo/hashing/HashSearcherMain.java index 4783536e..ea27a2ae 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/HashSearcherMain.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/HashSearcherMain.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/HashTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/HashTest.java index bd0b49c7..25f972de 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/HashTest.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/HashTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/HashTestSupport.java b/src/test/java/net/openhft/chronicle/algo/hashing/HashTestSupport.java new file mode 100644 index 00000000..76896d19 --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/hashing/HashTestSupport.java @@ -0,0 +1,244 @@ +/* + * Copyright 2014-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.chronicle.algo.hashing; + +import net.openhft.chronicle.algo.bytes.Access; +import net.openhft.chronicle.algo.bytes.NativeAccess; +import net.openhft.chronicle.core.Jvm; + +import java.nio.ByteBuffer; +import java.util.Arrays; + +import static java.nio.ByteOrder.nativeOrder; +import static org.junit.Assert.assertEquals; + +final class HashTestSupport { + + private static final Access BYTE_BUFFER_ACCESS = Access.checkedByteBufferAccess(); + private static final NativeAccess BYTE_ARRAY_ACCESS = NativeAccess.instance(); + + private HashTestSupport() { + } + + static byte[] loopingBytes(int len) { + byte[] data = new byte[len]; + for (int i = 0; i < len; i++) { + data[i] = (byte) i; + } + return data; + } + + static void assertHashMatchesVectors(LongHashFunction function, byte[] data, long expected) { + int len = data.length; + assertEquals("hashBytes", expected, function.hashBytes(data)); + assertEquals("hashBytes(ByteBuffer)", + expected, + function.hashBytes(ByteBuffer.wrap(Arrays.copyOf(data, len)).order(nativeOrder()))); + + ByteBuffer wrapped = ByteBuffer.allocate(len + 8).order(nativeOrder()); + wrapped.put((byte) 0x7F); + wrapped.put(data); + wrapped.flip(); + wrapped.position(1); + wrapped.limit(1 + len); + assertEquals("hashBytes(ByteBuffer slice)", expected, function.hashBytes(wrapped)); + + if (len == 0) { + assertEquals("hashVoid", expected, function.hashVoid()); + } + + ByteBuffer bb = ByteBuffer.wrap(Arrays.copyOf(data, Math.max(len, 8))).order(nativeOrder()); + exercisePrimitiveHashes(function, bb, len, expected); + exerciseArrayHashes(function, bb, len, expected); + exerciseReadAccess(function, data, expected); + exerciseNegativePrimitiveHashes(function); + } + + private static void exercisePrimitiveHashes(LongHashFunction function, + ByteBuffer buffer, + int len, + long expected) { + if (len >= 1) { + long byteHash = function.hashByte(buffer.get(0)); + if (len == 1) { + assertEquals("hashByte", expected, byteHash); + } + } + + if (len >= 2) { + short value = buffer.getShort(0); + long shortHash = function.hashShort(value); + if (len == 2) { + assertEquals("hashShort", expected, shortHash); + assertEquals("hashChar", expected, function.hashChar((char) value)); + } + } + + if (len >= 4) { + int value = buffer.getInt(0); + long intHash = function.hashInt(value); + if (len == 4) { + assertEquals("hashInt", expected, intHash); + } + } + + if (len >= 8) { + long value = buffer.getLong(0); + long longHash = function.hashLong(value); + if (len == 8) { + assertEquals("hashLong", expected, longHash); + } + } + } + + private static void exerciseArrayHashes(LongHashFunction function, + ByteBuffer buffer, + int len, + long expected) { + assertEquals("hashBytes(byte[],off,len)", + expected, + function.hashBytes(padArray(dataWithPadding(buffer, len), 1), 1, len)); + + if ((len & 1) == 0) { + short[] shorts = toShortArray(buffer, len); + assertEquals("hashShorts", expected, function.hashShorts(shorts)); + assertEquals("hashShorts(off,len)", + expected, + function.hashShorts(padArray(shorts, (short) 1), 1, shorts.length)); + + char[] chars = toCharArray(buffer, len); + assertEquals("hashChars", expected, function.hashChars(chars)); + assertEquals("hashChars(off,len)", + expected, + function.hashChars(padArray(chars, (char) 1), 1, chars.length)); + } + + if ((len & 3) == 0) { + int[] ints = toIntArray(buffer, len); + assertEquals("hashInts", expected, function.hashInts(ints)); + assertEquals("hashInts(off,len)", + expected, + function.hashInts(padArray(ints, 1), 1, ints.length)); + } + + if ((len & 7) == 0) { + long[] longs = toLongArray(buffer, len); + assertEquals("hashLongs", expected, function.hashLongs(longs)); + assertEquals("hashLongs(off,len)", + expected, + function.hashLongs(padArray(longs, 1L), 1, longs.length)); + } + } + + private static void exerciseReadAccess(LongHashFunction function, byte[] data, long expected) { + long baseOffset = Jvm.arrayByteBaseOffset(); + assertEquals("hash(ReadAccess)", + expected, + function.hash(data, BYTE_ARRAY_ACCESS, baseOffset, data.length)); + + ByteBuffer buffer = ByteBuffer.wrap(data).order(nativeOrder()); + assertEquals("hash(ReadAccess ByteBuffer)", + expected, + function.hash(buffer, BYTE_BUFFER_ACCESS, buffer.position(), buffer.remaining())); + } + + private static void exerciseNegativePrimitiveHashes(LongHashFunction function) { + byte[] bytes = new byte[8]; + Arrays.fill(bytes, (byte) -1); + long byteHash = function.hashBytes(bytes, 0, 1); + long shortHash = function.hashBytes(bytes, 0, 2); + long intHash = function.hashBytes(bytes, 0, 4); + long longHash = function.hashBytes(bytes, 0, 8); + + assertEquals("hashByte(-1)", byteHash, function.hashByte((byte) -1)); + assertEquals("hashShort(-1)", shortHash, function.hashShort((short) -1)); + assertEquals("hashChar(-1)", shortHash, function.hashChar((char) -1)); + assertEquals("hashInt(-1)", intHash, function.hashInt(-1)); + assertEquals("hashLong(-1)", longHash, function.hashLong(-1L)); + } + + private static byte[] dataWithPadding(ByteBuffer source, int len) { + byte[] copy = new byte[len]; + ByteBuffer duplicate = source.duplicate(); + duplicate.position(0); + duplicate.get(copy, 0, len); + return copy; + } + + private static byte[] padArray(byte[] original, int pad) { + byte[] copy = new byte[original.length + 2 * pad]; + System.arraycopy(original, 0, copy, pad, original.length); + return copy; + } + + private static short[] padArray(short[] original, short pad) { + short[] copy = new short[original.length + 2]; + System.arraycopy(original, 0, copy, 1, original.length); + copy[0] = pad; + copy[copy.length - 1] = pad; + return copy; + } + + private static char[] padArray(char[] original, char pad) { + char[] copy = new char[original.length + 2]; + System.arraycopy(original, 0, copy, 1, original.length); + copy[0] = pad; + copy[copy.length - 1] = pad; + return copy; + } + + private static int[] padArray(int[] original, int pad) { + int[] copy = new int[original.length + 2]; + System.arraycopy(original, 0, copy, 1, original.length); + copy[0] = pad; + copy[copy.length - 1] = pad; + return copy; + } + + private static long[] padArray(long[] original, long pad) { + long[] copy = new long[original.length + 2]; + System.arraycopy(original, 0, copy, 1, original.length); + copy[0] = pad; + copy[copy.length - 1] = pad; + return copy; + } + + private static short[] toShortArray(ByteBuffer buffer, int len) { + short[] shorts = new short[len / 2]; + buffer.duplicate().order(nativeOrder()).asShortBuffer().get(shorts); + return shorts; + } + + private static char[] toCharArray(ByteBuffer buffer, int len) { + char[] chars = new char[len / 2]; + buffer.duplicate().order(nativeOrder()).asCharBuffer().get(chars); + return chars; + } + + private static int[] toIntArray(ByteBuffer buffer, int len) { + int[] ints = new int[len / 4]; + buffer.duplicate().order(nativeOrder()).asIntBuffer().get(ints); + return ints; + } + + private static long[] toLongArray(ByteBuffer buffer, int len) { + long[] longs = new long[len / 8]; + buffer.duplicate().order(nativeOrder()).asLongBuffer().get(longs); + return longs; + } + +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterMain.java b/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterMain.java index 29685da2..05275287 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterMain.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterMain.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterRunner.java b/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterRunner.java index 9ad0a76d..180b4666 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterRunner.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/HashTesterRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/LongHashFunctionTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/LongHashFunctionTest.java index ffd95f4c..2f9b9150 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/LongHashFunctionTest.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/LongHashFunctionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3CompatibilityTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3CompatibilityTest.java new file mode 100644 index 00000000..3c4078fd --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3CompatibilityTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2014-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.chronicle.algo.hashing; + +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.stream.IntStream; + +/** + * Cross-check the MurmurHash3 implementation against Guava's reference for a wide + * range of input sizes. + */ +class MurmurHash3CompatibilityTest { + + private static final int MAX_LEN = 256; + + static IntStream lengths() { + return IntStream.rangeClosed(0, MAX_LEN); + } + + @ParameterizedTest(name = "unseeded len={0}") + @MethodSource("lengths") + void unseededMatchesGuava(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + long expected = lowerLong(Hashing.murmur3_128().hashBytes(data).asBytes()); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.murmur_3(), data, expected); + } + + @ParameterizedTest(name = "seeded len={0}") + @MethodSource("lengths") + void seededMatchesGuava(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + HashFunction reference = Hashing.murmur3_128(42); + long expected = lowerLong(reference.hashBytes(data).asBytes()); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.murmur_3(42L), data, expected); + } + + private static long lowerLong(byte[] bytes) { + ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); + return buffer.getLong(); + } +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3MoreTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3MoreTest.java index a6d0c2d2..3d5efb74 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3MoreTest.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3MoreTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3Test.java b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3Test.java index f15b2acc..f10b87db 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3Test.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/MurmurHash3Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/RandomOptimiser.java b/src/test/java/net/openhft/chronicle/algo/hashing/RandomOptimiser.java index 6d178fbc..b9f5197e 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/RandomOptimiser.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/RandomOptimiser.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 chronicle.software + * Copyright 2015-2025 chronicle.software * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/ReferenceData.java b/src/test/java/net/openhft/chronicle/algo/hashing/ReferenceData.java new file mode 100644 index 00000000..00670582 --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/hashing/ReferenceData.java @@ -0,0 +1,58 @@ +package net.openhft.chronicle.algo.hashing; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +final class ReferenceData { + + private static final String RESOURCE_PREFIX = "net/openhft/chronicle/algo/hashing/reference/"; + + private ReferenceData() { + } + + static String load(String fileName) { + Path source = Paths.get("..", "Zero-Allocation-Hashing", "src", "test", "java", + "net", "openhft", "hashing", fileName); + + IOException fileReadException = null; + if (Files.isRegularFile(source)) { + try { + byte[] bytes = Files.readAllBytes(source); + return new String(bytes, StandardCharsets.UTF_8); + } catch (IOException e) { + fileReadException = e; + } + } + + String resourcePath = RESOURCE_PREFIX + fileName; + try (InputStream stream = ReferenceData.class.getClassLoader().getResourceAsStream(resourcePath)) { + if (stream != null) { + return readStream(stream); + } + } catch (IOException e) { + throw new IllegalStateException("Unable to read reference vectors from classpath resource " + resourcePath, e); + } + + if (fileReadException != null) { + throw new IllegalStateException("Unable to read reference vectors from " + source, fileReadException); + } + + throw new IllegalStateException("Reference vector file " + fileName + + " not found. Expected either " + source + " or classpath resource " + resourcePath); + } + + private static String readStream(InputStream stream) throws IOException { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + byte[] data = new byte[8192]; + int read; + while ((read = stream.read(data)) != -1) { + buffer.write(data, 0, read); + } + return new String(buffer.toByteArray(), StandardCharsets.UTF_8); + } +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/XxHashRegressionTest.java b/src/test/java/net/openhft/chronicle/algo/hashing/XxHashRegressionTest.java new file mode 100644 index 00000000..a7d89157 --- /dev/null +++ b/src/test/java/net/openhft/chronicle/algo/hashing/XxHashRegressionTest.java @@ -0,0 +1,56 @@ +package net.openhft.chronicle.algo.hashing; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +class XxHashRegressionTest { + + private static final long[] XX_HASH_WITHOUT_SEED = loadVector( + "XxHashTest.java", "HASHES_OF_LOOPING_BYTES_WITHOUT_SEED"); + private static final long[] XX_HASH_WITH_SEED = loadVector( + "XxHashTest.java", "HASHES_OF_LOOPING_BYTES_WITH_SEED_42"); + private static final int MAX_LEN = Math.min(XX_HASH_WITHOUT_SEED.length, XX_HASH_WITH_SEED.length) - 1; + + static IntStream lengths() { + return IntStream.rangeClosed(0, MAX_LEN); + } + + @ParameterizedTest(name = "unseeded len={0}") + @MethodSource("lengths") + void unseededVectorsMatchReference(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.xx_r39(), + data, + XX_HASH_WITHOUT_SEED[len]); + } + + @ParameterizedTest(name = "seeded len={0}") + @MethodSource("lengths") + void seededVectorsMatchReference(int len) { + byte[] data = HashTestSupport.loopingBytes(len); + HashTestSupport.assertHashMatchesVectors(LongHashFunction.xx_r39(42L), + data, + XX_HASH_WITH_SEED[len]); + } + + private static long[] loadVector(String fileName, String arrayName) { + String content = ReferenceData.load(fileName); + Pattern pattern = Pattern.compile(arrayName + "\\s*=\\s*(?:new\\s+long\\s*\\[\\s*\\]\\s*)?\\{([^}]*)\\}", Pattern.DOTALL); + Matcher matcher = pattern.matcher(content); + if (!matcher.find()) { + throw new IllegalStateException("Array " + arrayName + " not found in " + fileName); + } + String body = matcher.group(1); + return Stream.of(body.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .map(s -> s.endsWith("L") ? s.substring(0, s.length() - 1) : s) + .mapToLong(Long::parseLong) + .toArray(); + } +} diff --git a/src/test/java/net/openhft/chronicle/algo/hashing/XxHash_r39_Test.java b/src/test/java/net/openhft/chronicle/algo/hashing/XxHash_r39_Test.java index 4efbd3ff..ed51734d 100644 --- a/src/test/java/net/openhft/chronicle/algo/hashing/XxHash_r39_Test.java +++ b/src/test/java/net/openhft/chronicle/algo/hashing/XxHash_r39_Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/algo/locks/LockingStrategyTest.java b/src/test/java/net/openhft/chronicle/algo/locks/LockingStrategyTest.java index d65a4052..24cc028a 100644 --- a/src/test/java/net/openhft/chronicle/algo/locks/LockingStrategyTest.java +++ b/src/test/java/net/openhft/chronicle/algo/locks/LockingStrategyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 chronicle.software + * Copyright 2014-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/net/openhft/chronicle/map/locks/ChronicleStampedLockTest.java b/src/test/java/net/openhft/chronicle/map/locks/ChronicleStampedLockTest.java index 47763f90..f66740bb 100644 --- a/src/test/java/net/openhft/chronicle/map/locks/ChronicleStampedLockTest.java +++ b/src/test/java/net/openhft/chronicle/map/locks/ChronicleStampedLockTest.java @@ -1,7 +1,5 @@ /* - * Copyright 2016-2022 chronicle.software - * - * https://chronicle.software + * Copyright 2016-2025 chronicle.software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/resources/net/openhft/chronicle/algo/hashing/reference/City64_1_1_Test.java b/src/test/resources/net/openhft/chronicle/algo/hashing/reference/City64_1_1_Test.java new file mode 100644 index 00000000..d13e7517 --- /dev/null +++ b/src/test/resources/net/openhft/chronicle/algo/hashing/reference/City64_1_1_Test.java @@ -0,0 +1,2139 @@ +/* + * Copyright 2014-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.hashing; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.util.ArrayList; +import java.util.Collection; + +import static org.junit.runners.Parameterized.Parameter; +import static org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class City64_1_1_Test { + + @Parameters + public static Collection data() { + ArrayList data = new ArrayList(); + for (int len = 0; len < 1025; len++) { + data.add(new Object[]{len}); + } + return data; + } + + @Parameter + public int len; + + @Test + public void testCityWithoutSeeds() { + test(LongHashFunction.city_1_1(), HASHES_OF_LOOPING_BYTES_WITHOUT_SEEDS); + } + + @Test + public void testCityWithOneSeed() { + test(LongHashFunction.city_1_1(0L, 0L), HASHES_OF_LOOPING_BYTES_WITH_SEEDS_0_0); + } + + public void test(LongHashFunction city, long[] hashesOfLoopingBytes) { + byte[] data = new byte[len]; + for (int j = 0; j < data.length; j++) { + data[j] = (byte) j; + } + LongHashFunctionTest.test(city, data, hashesOfLoopingBytes[len]); + } + +// The following numbers is the result of compiling & running this program +// with city-1.1.1, reference impl: +// +// #include +// #include +// #include +// +// main() { +// char* src = (char*) malloc(1024); +// for (int i = 0; i < 1024; i++) { +// src[i] = (char) i; +// } +// printf("without seeds\n"); +// for (int i = 0; i <= 1024; i++) { +// printf("%lldL,\n", (long long)CityHash64(src, i)); +// } +// printf("with seeds 0, 0\n"); +// for (int i = 0; i <= 1024; i++) { +// printf("%lldL,\n", (long long)CityHash64WithSeeds(src, i, 0, 0)); +// } +// } + + public static final long[] HASHES_OF_LOOPING_BYTES_WITHOUT_SEEDS = { + -7286425919675154353L, + -4728684028706075820L, + -4422457430495752843L, + -7736835464683084646L, + -9025216361070533312L, + -5422428610433466039L, + -7854914535251369165L, + -6710152398449367391L, + -5955425696247891048L, + -9135800243314829233L, + -7246206370539175958L, + -927412511068636451L, + -6929387038567547523L, + -4483949857698136942L, + 5465584872023869041L, + -8779115096593678947L, + 1080060857502750420L, + -4920561954712641764L, + 8788987475711186918L, + -7811586469569372367L, + -8225851168889855767L, + -1446326939218740700L, + 2947276334089957408L, + 460179928224693724L, + 4556289589497654983L, + -5431404645194118082L, + 1374684061788708333L, + 4791352535680686582L, + -6530211739313377370L, + -7635818062080712801L, + 5236473510478810791L, + -299119187023926975L, + 1917831512995979081L, + 5107424530006203066L, + -5351750064093194974L, + 2946934858665984768L, + 5031111514403073L, + 3910662880520648515L, + 7104787927248062489L, + -6487722535395806461L, + 3960877915061173532L, + -4579031603096916569L, + -3869369943781850205L, + 5545493761745899838L, + -7059462733818922495L, + 6807020698875987225L, + -404529411533207610L, + -5190881841756839606L, + -4104575122654935515L, + 6967381383547484689L, + 8297988497614279881L, + 8680592459788761385L, + -3059691078085565528L, + -6315132929596828281L, + -4334276152181959987L, + -535710436645363679L, + -7591547014909512897L, + -6322657031286798644L, + 7490021577199580942L, + -8877856250499437898L, + -1633403071681209495L, + -5579376360386761981L, + 3395840816824425443L, + -5822993263498516753L, + -1613775140304724827L, + -6027895920215728850L, + -5805352503949881486L, + 1532677441468290047L, + -8648407032749049966L, + -2939164377159033571L, + -4702680364495832252L, + 105631500981943270L, + -7893756812661322999L, + 5760642662739372587L, + -6215695861042047454L, + 1238201813735746316L, + -4809334409104512081L, + 2347957779168721077L, + 9062861991168352058L, + 6741188021946160720L, + 5759783405795756054L, + -7404571833801891275L, + 5236586458250640726L, + -6440402695065204540L, + 7127501107294950542L, + -8740931757300170334L, + 5534676620576843972L, + -4574941845361945294L, + -9883751627416689L, + 7607362424232991178L, + -3354796234778573261L, + -3645150900513625504L, + -6488903739323758581L, + 6012082827380234497L, + -5054558154612698247L, + 3912192630192643044L, + -2020201547348302146L, + -5668877223161468438L, + 8268442247828559279L, + -5794570113714942465L, + -6593295974839137082L, + -3017674363433867291L, + 9132819821668885553L, + 4741264366937614131L, + 830814054897026754L, + -2034640718262093716L, + 8943931193848644945L, + -8152524248109219563L, + -6859491045979443967L, + 5989638100417143996L, + -3267834036936991810L, + -7636942225548479235L, + -4414857242429251885L, + -2291796691719558349L, + -443263958430047225L, + 7365713933907296010L, + -3873163659277696512L, + 3210434025964027265L, + 4488179162024237572L, + -4930451962295763338L, + 7001793786790109268L, + 2260583935679101347L, + 6302158474829298170L, + -2419988900997440242L, + -8014717202309677597L, + -8235679274201152527L, + -5412354269470908685L, + -1164721218407162475L, + 1202834260335129493L, + 5097669210588415856L, + 5123804704029457567L, + -6598196598389898964L, + -6869069910041547416L, + -928355525786123860L, + -966564912375064896L, + 4636972776252349972L, + -2242946385954433108L, + -2308096272056919881L, + -6298993315544438985L, + -3151578775439575412L, + -2981346332242477399L, + 6868228731909122983L, + -6986102546523057772L, + 3966488015587306733L, + -7964296030132213922L, + -5968054086424703428L, + -5682984903553203201L, + 1262045945453884357L, + -8506021221334832979L, + 7003579340962719964L, + 7942843347128085593L, + 3274150487722006282L, + 4427242625667076769L, + -5558614835558052533L, + 8189732125765662222L, + -2778584257768737506L, + -6226635033105800171L, + 7651720467242209474L, + 9181931113760444130L, + 2531900585268751432L, + 5021256001343290469L, + -5934384589108485717L, + -1862924803786167203L, + 1489099108801110675L, + 7297283605813218793L, + -8415280978394092215L, + -4126156388588540951L, + -3706737886726786804L, + -2710208030451980715L, + -8047451206915723423L, + -1218572947384892459L, + 8297865478600584233L, + 8165902466320925460L, + 5554419482037121102L, + 4417403317404803986L, + -6616982450866646170L, + -7959099281697237016L, + -3114405717510473052L, + -1857505830677138154L, + -1018685550688766348L, + 5207428187340024429L, + 5300227297807876147L, + -2390037343420204123L, + -448127685853213712L, + -6225388303620718856L, + 2389000856964185630L, + -2067625213238325040L, + -241429434055336511L, + -8970491894816477388L, + -6897203400744644612L, + -4604959413085934526L, + 2400135546673933001L, + -3045961230403678092L, + -1917277105023051478L, + 8197811581050490133L, + 3786786968548875789L, + 4625663088087573665L, + -2168704627193825976L, + 7192692656796588680L, + 2481695319570886548L, + -805495018187668520L, + 5671304642231997436L, + -4228301512035074347L, + -7701083686405511339L, + -1427738904980858657L, + 8356642386295377804L, + -353719534132831289L, + 706229336943583572L, + -9168064130899442751L, + 8265029971140615336L, + -2707147319767299550L, + 7353033265757382049L, + 8397636325397273152L, + -6517736165712294631L, + 6949546038097145245L, + 1648771344345529694L, + 6558709565158356186L, + 1808377088858220390L, + 2838565433860722913L, + 1308279908036033190L, + 8824692270735996388L, + 4066525655875567756L, + 5152272828145679687L, + -3469524600427842330L, + 188800643931297464L, + 7173304178017026190L, + -5347641926849324594L, + -8829553366459830305L, + 8778291414581187896L, + 593871733331593377L, + 2192404833132388154L, + -3564506003420601160L, + 2859700462125450624L, + -7123068915788342214L, + -9199725509076335326L, + 4749263509373213952L, + -3638383731952186227L, + -6283092296877861618L, + -2825268767310280965L, + 7643742019486170884L, + 7034401305567905177L, + -31827767771004462L, + -3569709783922447606L, + 1011781009512126791L, + -5982832679535324039L, + 2402494289382923228L, + 5378572830995800063L, + -4978012351095471455L, + -3034756850229693434L, + -6743229956355567041L, + -1028117510121450274L, + -1267497062066519287L, + -5053670629173080711L, + -460732196015338926L, + -6371275689446166637L, + 6288834997689259448L, + 894299094737143437L, + -6014774806034970825L, + -3271595897687689742L, + -7449732170732070004L, + 506523418677247916L, + -687365991489907728L, + 8228603339396783688L, + 7211450665110285461L, + -3009830902792319569L, + -5417937957852652579L, + 6051039017008413932L, + -5925978207158526805L, + -2615140071349844608L, + -8654933370440320601L, + -6342253313262031587L, + 4461643906497668150L, + -819522441838551231L, + -1359425915347178296L, + 1075135447892840058L, + 7643058122247322338L, + -4070529264423045602L, + 6335201156325848872L, + 4776486447069195757L, + -4254562051076226566L, + 5766929006988848669L, + -884034037937901831L, + 1766456663364676290L, + -4311719146183820266L, + 7666581505151857266L, + 671421170492658629L, + -1964099404051832475L, + 1732360456059290553L, + -297869400412879955L, + -9030316701971057409L, + -9075660047343779046L, + 3583673289738670454L, + -9182941546024088613L, + 1136735461790749536L, + 8366765554392407195L, + -5540891596657836355L, + -7821100180551973617L, + -1977279128251662041L, + -2356171669808568513L, + -2015573691705664756L, + 4488487306883615842L, + 4851354791727756109L, + -3251092166327359481L, + -601646434326145067L, + 776101951221215280L, + -6668237828878985553L, + 7844860178588967334L, + 64341060285013340L, + 7036395122924142569L, + -7724784063616999535L, + 2914805329168628994L, + 7621906733182421570L, + 2118815299569935033L, + -8611860394051996699L, + -2517166550051884828L, + -6993083065762083347L, + 2404060287424189503L, + -8081836069740145167L, + -6067471269374793929L, + 3439258482592575547L, + -6466818119401182672L, + 1855293097271252452L, + -6761456087842467624L, + 6656763620585181420L, + -4645642491601388295L, + -8829570488301084514L, + -6279091021271619556L, + -1913500423661250093L, + -8293385927741834686L, + -808977409753631920L, + -2730813255791690623L, + 760899304567634337L, + 3447062143237006129L, + -8842923486609316688L, + -1505518261280441404L, + -8952792346352363916L, + -3654437654855386526L, + -8894745855055459645L, + 253433424322101103L, + 9087982386284623409L, + 5229689677888986164L, + 7591231218923024443L, + -6553455979736582189L, + -6817900072998950224L, + 1012237197570815938L, + -1041501749233381438L, + 6870652863042402620L, + 7290269702536111943L, + -2011669460814939543L, + -4739132450972235476L, + 6066906978691731285L, + 1546459970278232517L, + 7264475946711979454L, + -6827279988316999463L, + 6948666464698968123L, + 5066099854277588391L, + 3617923505625432817L, + 1470423865947425164L, + -2407848614631507329L, + -2721518777381923816L, + -8523365410901703222L, + 4677154254765168702L, + -3770388132335360433L, + 2921549272211529780L, + -675990637368864946L, + 851813270104783927L, + 1645312556841013286L, + 7927523946826503527L, + 2802530705554935060L, + 4420122776914984561L, + 5168061431322460870L, + -3637982376709290280L, + -4792218222117838791L, + -1594804027447799011L, + 7019536217023665362L, + 5718841507582027847L, + 1100038721024625254L, + 4344644567377313784L, + 8200393826966791959L, + 8894425291364977602L, + 2359988989741956746L, + 33375660597707981L, + 3669152498936403685L, + -2718673953441374568L, + 92663594252170279L, + -4255839685607808051L, + -712976418504655651L, + 4188336312392147780L, + 2678387573955385138L, + 5321904963044271153L, + -6249628719291181094L, + -8876650223107687355L, + 8352423161613591273L, + -2028799093461825949L, + 9011909818387084247L, + -5940434430375305675L, + 3490020360211624506L, + 8424335559697179192L, + 3222699924556192045L, + 7964158943145881894L, + 330499497334085755L, + 8764983981643618893L, + -1653480401860466428L, + -1353880172593700164L, + -6469256613830029852L, + -4893038789738483635L, + 8164190368596497481L, + 5278453078131476326L, + 910888251237419688L, + 3697943209022914547L, + 5449624560010431329L, + -3584621013753301872L, + 654189080535454533L, + -7562028051554401340L, + 8924718183483314324L, + -1485127518392421693L, + 3918745837987619627L, + -4539406462388765487L, + 5483323815514497307L, + 6306137176139938292L, + -807721373860280201L, + -9165053290624784358L, + 2697602178198341027L, + 4348395670472375164L, + -400178961926803853L, + -7689451542459549880L, + 4509866787834747782L, + 9185710136408363969L, + 7923865403849230565L, + -5869104529577485293L, + 4854955700697037319L, + 9191216701481807090L, + -679449825281621614L, + -3189846996545570031L, + -8083169535868277187L, + -9174257325298378624L, + -4552176765196275L, + 1628631992923682209L, + 8319654855481955340L, + 8861739932800214810L, + -993117140134665724L, + -7815627532394322917L, + -5524260825536443502L, + 6983369624720592264L, + 2975165537865741602L, + 1451865941470664872L, + 8661262499023857011L, + 9204748273209932460L, + -5006258975566865529L, + -1964973191525498109L, + -6345850612890808987L, + 6330350968582806446L, + -4566626859227178484L, + 4080473761572400112L, + -6346529945189783184L, + 7055723585952818695L, + 7811169230131832954L, + -7306057383456388215L, + 5652715072883610701L, + -2250631360270905098L, + 8948341566778589071L, + -7814352745627737399L, + -2083093040021743435L, + -4144374577642832518L, + 4554659244267885692L, + -4805527992091411974L, + 3879386590110957199L, + -7095733810311131713L, + 4218157720399299286L, + -3959329580238802474L, + 1731201417108224317L, + -8732695545326287246L, + -8127721874141088173L, + 2847953048942004818L, + -2848770956679986940L, + 1154351656441528122L, + 4106410957236720378L, + 477496151948916105L, + 8872899165245904476L, + 3834365941712504069L, + 8233875208097499501L, + 6544005900573385217L, + 371511961864400977L, + 5302630743605424838L, + 7619059416641067912L, + 938163523491488924L, + -2193498991179441780L, + -4381948476662408917L, + 2437161357208041044L, + -1853214813114072629L, + 4032256607594450812L, + -4569645391300269034L, + 996805768016039863L, + -5352653220786799159L, + -4072867815316954984L, + 5829678081429819442L, + 5854970045203806958L, + 7196705546676684298L, + 8855821442059151758L, + 1691257326941530873L, + 516443419472701223L, + -189326359229885042L, + -7069256705822756785L, + 8484184957260042276L, + 4751495376086537417L, + -3538622506527375158L, + -1130604628135516641L, + -662884267626379918L, + -1626547571415880505L, + 4362310446718468471L, + -4692137164995780722L, + -1878686192989058772L, + -1262801893323802033L, + 316850896103923056L, + -8337266500312820398L, + -7607930981261565972L, + -7606942324380249703L, + -1863279537410737853L, + 515589381621691011L, + 1963273998306328480L, + 3626876516104382454L, + -4734613701579936168L, + 1268078677159514015L, + -7562820495728610458L, + -5881301520585529952L, + 7263589689395116216L, + 3332748335049164596L, + -928492619425385303L, + -8439668591687876707L, + 6057690584855876482L, + 7709510645357107021L, + 688216636303161488L, + 191126336719796113L, + 4222857931985709754L, + 5163370007345445271L, + -6942747002185630386L, + -2732326623400822979L, + 41325922645173190L, + 4083911336538913161L, + 3094117323938386883L, + 3557206941692843782L, + -2802805090114871259L, + -396752131642527880L, + -3107705530439472535L, + 8070257791496704758L, + 5555978803158201323L, + 4409520550497292548L, + 6336286888800178635L, + 3317356027694838288L, + 2401575734406277533L, + -7762952901621766636L, + -8495556902666486415L, + -6098553262029734092L, + 364791930541331805L, + -3034434066885855765L, + 7941447497229394663L, + -6311456469393535820L, + -3224469377911062967L, + 8110978943348454528L, + 7644406205313833523L, + 8931656291415416874L, + 4830016430262424325L, + -8438474386071045565L, + 6477831547342095051L, + 3795147179128460013L, + 2753065962007277619L, + 6069828580914843210L, + -5070382024314025872L, + 1576707579300544287L, + 5453704031214058740L, + -1035262976071773160L, + 3387395655425490542L, + -4848984716268304731L, + 8616838443866781524L, + -3948140786885003158L, + 3962330984502924344L, + -3394110440125760919L, + 8437322113039475260L, + -4462275713722410457L, + -9105148434050568503L, + -5788212949545869877L, + 4557608001681875598L, + -621234956095881342L, + 1797543657423762991L, + 6130226975770239840L, + -6937918406956986622L, + 4193803048882394276L, + 4324662453655033332L, + 3904929732026970589L, + -5512830190293331704L, + -5238129213566557209L, + 540373761178912749L, + 3337453168137959715L, + 8356242320057396388L, + -4507786512266822044L, + -698048955859231008L, + 1181416669291835619L, + 3643161574413908044L, + -4297980572116458092L, + -2910009689167799889L, + -9219400384203405648L, + 2837257119074162583L, + -8143475796343843303L, + -6701262784428931798L, + -3566846192190811525L, + -5826064075185101904L, + 7314616728107169430L, + -7237382661205518959L, + 6614127174385956622L, + 4579105225630387051L, + -4031772022249101869L, + -3620132425485383754L, + -6583523957977840094L, + 6091510613049819644L, + -6657436664451253776L, + 8818554346883882723L, + 1172158546676437076L, + 2582843905454312864L, + -875396097026320083L, + -8848203911887421254L, + 6216447546397552656L, + 5663680539561409764L, + 209883782871623112L, + 6956397065493936061L, + -5822486364606447659L, + -2376186988282686016L, + -6524574392506270574L, + -5270703630108479361L, + 5121019866792000912L, + 945935884404515280L, + -3784584736823369966L, + -2986471018582996853L, + -3856234881587215840L, + 6305579424806652269L, + -4601892864817094249L, + -4715544044948588160L, + -1178634098444085344L, + -4565928887270776879L, + 3733099898005319061L, + 6069592779991791222L, + 9107963518416746035L, + 6039316923758014718L, + 8297782059544644167L, + -2184105415491254451L, + 2001634139595818848L, + 9198267247175603385L, + -971507504085650973L, + 1529684592715776773L, + -6499571738329764748L, + 2692794621907637848L, + 3620078955080706311L, + -3810905539411016286L, + -4315538097904969971L, + 238288165777703356L, + 3801607999515704624L, + -8796282819004971627L, + -7143692292464130110L, + -2163491158557034519L, + -9011885533150911632L, + 9155112387717094928L, + 9088915215752483036L, + -1237520018892636128L, + -6753599194173607835L, + 336577035174699985L, + 4747700477808735060L, + 931844140272524176L, + -4257344590201194145L, + -670422981995636407L, + 2500401999619637609L, + 7406487034015272912L, + -384292968442149342L, + -7987787036136248263L, + -2653231840350927715L, + 4488358012056331513L, + 4132004061554806745L, + 2000006126034333275L, + 2367660688967266790L, + -4085353431072751340L, + -6333747719369049272L, + -4139886406965236122L, + -5592180402897144267L, + 5629551944241090329L, + 2272991263231641145L, + -5168344584178448710L, + 5982172003825524793L, + -4097896509839310227L, + -2173000713225115918L, + 7108547918299652551L, + -8878799355822473463L, + -6248630805665498946L, + 5163839098786800196L, + 5795734275921137263L, + -7245153276785179186L, + -7094809303783005595L, + -1803470859826091831L, + 4874431305017870420L, + -8839194352522271777L, + 4701999825563368375L, + -3679426707168942163L, + 4734328664805795607L, + -768556148270379847L, + 3947269125893368179L, + 4714950126806030589L, + -5247268458767477724L, + -1879729542263864540L, + 1641255074942093290L, + -9116204329902429525L, + -364742432814767105L, + -69357515456246742L, + 8333855547662608034L, + 1864002674034900754L, + 6403905632971416781L, + -7065616950334616275L, + -8174670288470068397L, + -1788643243994894927L, + 2040528535819048731L, + -7614591261684631428L, + -8476219755505693753L, + 3296595282811904830L, + -4038686171536252708L, + -173444937930635352L, + 4379378816273396403L, + -1083617946856135532L, + 2829396743633429008L, + 7647167960435994992L, + -6693126224881188257L, + 3108807460115157477L, + 8562491110202112769L, + -7424963641864880746L, + 2081921398431501385L, + 5209400744054399273L, + 5112090417850934870L, + 1524655582665697947L, + -5843275962356379462L, + -6334239724025378211L, + -7268154201988435641L, + 1659668141032724392L, + 7389323132785440806L, + 5590854007476007348L, + 5302894709895800109L, + 8939357616797202357L, + 8822514621675961012L, + -5171376528302818295L, + 1884135603723970677L, + 1618024292298833293L, + -1237011265202015266L, + -8040883111734337726L, + -5506883502078400727L, + -5535461054765222007L, + 6987425158845534706L, + -5917819605734669552L, + -128823547864917643L, + 2306699256825946343L, + 6578043582810501418L, + 1333071240688068841L, + -844978627973023134L, + 1165513423049959936L, + -3821092351522083096L, + 4178119893083594287L, + -7966305568215876834L, + -3090958372925773111L, + 6379864721688110803L, + 8454365886776707192L, + 7642874047594127629L, + -657318587403536924L, + 3801960633076006868L, + 1417228866369858393L, + -6177293427545629057L, + -4532758952191612784L, + 7264967871106174537L, + -4377935371893251778L, + -5733943093645858937L, + -6680841553969427023L, + -7726067291839077718L, + 8383662776008964734L, + -1112744575338004890L, + 6374190320986843773L, + -8999217966784745583L, + -7597176706996915696L, + -1016011267603323245L, + -8855672237269976658L, + 1866081428501204101L, + -5633137211449093941L, + -3633923734370033552L, + 6356569017217682507L, + 5058160257775482340L, + -7437707824467063063L, + 7650351067322618291L, + -7870694419219039600L, + 1007692631473636679L, + -6154343863836713521L, + 2504745592130278975L, + 88486550721415362L, + -7438916213215366445L, + 2983976134777543021L, + -4146088135092960461L, + 6999580209156770608L, + -7009740189170395954L, + 4126839178241879770L, + 5225682274323639211L, + 4660353570181491047L, + -3242111597353447920L, + 1803242034579090657L, + 8094113187590542457L, + 7111382607287164209L, + 3662908704051040727L, + -3379205925121269346L, + 6747462450220404315L, + 65992546736538642L, + 8188714708026451259L, + 7059032778575684879L, + -4375005614825264977L, + -6109413170920934528L, + 4325812979374770173L, + 6190341203443080272L, + 3806377003483660789L, + 7584471990548161252L, + -3767546025951476771L, + 5011498119849592471L, + 4585280751135869910L, + -2774285440269761924L, + -2219523968621249741L, + -6788014939853324942L, + -6760697001786001699L, + -1907834706280913583L, + 2768880461784823049L, + -629361951557696226L, + -5050911681363224361L, + -9166005476966639742L, + 31804289095347444L, + 639074948574684643L, + 6010055855691161228L, + -6702617244872776165L, + 4147599647636813218L, + 7651401543024655900L, + 4739867532288311604L, + -7311026522201000188L, + -2481600927193112363L, + -4295248724569156530L, + 5040986942772410406L, + 8763074685442978007L, + -7780650549244157320L, + 4727619369834180192L, + 8711570616947608575L, + 2722322146515041536L, + 5060226879657446005L, + -6544404061220128813L, + 6434919141259253970L, + -5427874400580062812L, + -7156085410253767250L, + -6601841961191942213L, + -9147266855024119868L, + -354433397501853706L, + -6814497327235846905L, + -8982035476653972472L, + 8930700532836854232L, + -1726278544235169634L, + 1951478969618711815L, + 851982242210611420L, + -6990203687021297279L, + 1368571238713408667L, + 2986039481571029352L, + -626535432523998987L, + 4415114859836957989L, + -8678134461890671357L, + -6061358215352047476L, + 7915140762335918295L, + -8378664661437708973L, + -3058127489434967617L, + 6225893737093916241L, + -1787758126471351031L, + -393755980982643891L, + -5268722683029966701L, + 4156689635576901740L, + 7365991146882099857L, + 8946946338475364603L, + 7319960897807520998L, + -2393576873586390100L, + 8152201155239646390L, + 115383870797338026L, + -7773145637941940242L, + -318186749599182520L, + 3089445632531235737L, + 7372359700832992279L, + -684419690766751897L, + 8663412456358708908L, + -8423162022518559117L, + -8645640258213218521L, + 3755512748576611566L, + -3913197578066841395L, + 5316673743969283163L, + 6831695766395531003L, + -8386643932900364475L, + 2245144203632789924L, + 5811854679522258384L, + -3767061474776765896L, + 5961692927981326209L, + -8247190832034282434L, + -2778260837579024711L, + -5629023501990762250L, + 8537394932332054145L, + -6062925171595331986L, + 6840408648564451314L, + 6831505181423122970L, + 6050924032963061444L, + 97002770831342714L, + -5440958264654316884L, + -8531281358297662856L, + -5585494473146494361L, + -8316232109598521210L, + -5015449123380194340L, + 546734480177265602L, + 4311680116951854912L, + -5000334068336613611L, + 5095429433761178592L, + -8984703830265496675L, + -1796164578353805109L, + -7862084290604723254L, + -3341202509537190675L, + -2120175014098274861L, + 6962378115816372563L, + 8337372275175376334L, + 2619274369511557562L, + -6859437991409806193L, + -6934562751052811686L, + -361162941396148816L, + 3477913128345375098L, + 6500092632270742214L, + -7787173285733693207L, + 1702735166445523176L, + 1447314647588646838L, + -6166213076072914876L, + 8250474851845160242L, + 3877968303074149070L, + 72258823402464273L, + -7794958806496084829L, + 582313431235093783L, + 5654370140388242557L, + 2361322084587394780L, + 7098843402525243411L, + 3090863845420947690L, + 9095251832683567577L, + 7351973108085879975L, + -5523854289062931886L, + 1385990973911762672L, + -1056696196230341112L, + -4777822501121417674L, + 7453925677222043959L, + 4245544569709356516L, + 4912957528661637311L, + -7303723525646889588L, + 8383839844005204972L, + 2636108895426426864L, + 7446083165659408850L, + -1230331481495042331L, + 2165552178018697300L, + 8589713469255323753L, + -104035337559208181L, + 9109517341871300972L, + -5557606019056305482L, + -2082770932342226712L, + -7664170423633849264L, + -6739763730657282594L, + 4217727556012572028L, + -4230549046719159326L, + -7870215613010795436L, + -1573598371112622115L, + 8374003956860023067L, + -4162778827118794697L, + -4999879893029494430L, + -5470698342693924491L, + -524838860730151022L, + 2056390379798965398L, + -7635140489953799830L, + -4895934908017276310L, + -8494320702432460395L, + 4375244527171869608L, + 5749214457757073666L, + 4541994463651552366L, + 4448135749491527723L, + 3252319268873763159L, + -4937698705299440219L, + -1443238972529269463L, + 5690643651433470600L, + -9020999177617872107L, + 5216703363076035920L, + 8692072066293807690L, + -2202944082561610978L, + -3202058202844418274L, + 9199667660131659024L, + -7208718625219556439L, + -8188854117697466457L, + 6229032659379082713L, + 6056662700481738610L, + -2741651824312128388L, + -5770752964459016300L, + -6200251094809993544L, + -8462183157391465625L, + 1991684432526984227L, + 7539287820084627776L, + 2339478854158321950L, + 6202507390678485586L, + 7743951748128383694L, + 4168070312184911657L, + 8672082835392561991L, + 6896073963991207358L, + 1101380276289164762L, + 6605809935833891247L, + -438522298677572710L, + 3905054981608874906L, + -1747754391336276367L, + 1032773222913269798L, + 6843327699919057660L, + -8003124643992369023L, + -631503341286938581L, + 4129740207606678749L, + -1702072036006461106L, + 7744011005333910111L, + -6885964098355695662L, + 6294542643192709825L, + -7426983010848522334L, + -2954466992510897276L, + -7979800600032271131L, + -8655210458445057123L, + -7169091905545403953L, + }; + + public static final long[] HASHES_OF_LOOPING_BYTES_WITH_SEEDS_0_0 = new long[]{ + 6665653827947065942L, + -5789604048565922719L, + -3544073118936500090L, + -2677072096376561857L, + 8974148226120660824L, + -4749991284220333463L, + 8297039314422555359L, + -8088911438875509914L, + 3424528861645039236L, + -421993933668452455L, + -3091699041169951528L, + 1163501013095869222L, + -1554311774836581326L, + 4121966646419608524L, + -5821497637003820218L, + -4128235463417739287L, + 1634251901919194052L, + -9040019856632616077L, + 1183275435239077349L, + -6101391766615068007L, + -3755326226698648655L, + 1818343754347462935L, + -6462354084044314322L, + -814980520133498484L, + 1615579219767298748L, + -6066678408453320652L, + -5834994416669600405L, + 6932484884661269235L, + -7738687275954138493L, + -445315170800868989L, + 6203156606326072466L, + -8944279252978819749L, + 5060297072545920013L, + -3956343463993130235L, + -9180490411183400199L, + -4817718227656051657L, + 785979865396935574L, + -7689259778972129265L, + 6878639307143602827L, + -1707085302887161029L, + -1565439692045367513L, + 145188358359952638L, + 5950830465561353178L, + -5798478302038700751L, + -2226708668641330939L, + 6469448358736909862L, + 8664958527704152036L, + 5535349946889143487L, + -5492973006601933162L, + 1056630503881604364L, + 309692344193328064L, + -1325766938638327983L, + -7482929830970430416L, + -4408424302596019484L, + -480574950088335999L, + -3307863187790378596L, + 3477765577142638670L, + -2331230081208486379L, + 3911594671769223260L, + -6780531386208631646L, + -8510677449436680990L, + -626520326023685130L, + 6361450738099140926L, + 2394752145895650387L, + -1428144106153991705L, + -8083151844911747669L, + -7436004472807581894L, + 5782046067893733552L, + -5292026140423046307L, + 5533934070794082284L, + -7662366745440754477L, + 2985568173297445164L, + 6966476425189845713L, + -7703121456776836315L, + -1510987927978493047L, + 7303134625337334164L, + -8202990867786288428L, + 1319339862757959960L, + -3077790914603251977L, + -8454808621776160478L, + -2753146122957105748L, + 3373398064125255264L, + 8346019299144821571L, + -8486870268569731271L, + -2336559059056769901L, + 4511628550243589470L, + 6951149477250785149L, + 5417720661433288424L, + 8309421963807893058L, + 5112522658470376561L, + 8234176485072859240L, + 7799608401388908342L, + 4378449040504281742L, + -7989739383215628611L, + -4732084855234830012L, + 3167384580555501185L, + -3643215394046503577L, + -7349901699683782836L, + -5349550264170666110L, + 756076486099874176L, + 4174502207370688508L, + -1151758869353979658L, + 8848338984622513194L, + 6395913475161294746L, + 1469705818420514455L, + -6295758011496721124L, + 5241715235088273374L, + -6511478119514275748L, + 8758910874313508247L, + -1699706016752355418L, + -690362402544790978L, + 2941321643463612597L, + -4293872409356543041L, + -8869301228299428567L, + 1141068614246669386L, + 647542286173136771L, + -5081241094287956867L, + 7611746854774550166L, + 8286824316663843591L, + 5293297384504364695L, + -5982798360475369212L, + -6572523711787919267L, + 4407085069020124145L, + 4613619958838436303L, + 7684164341448790302L, + 6756516403404278842L, + 2473985321567407573L, + -1849052731267467607L, + -560354543015577264L, + -373043150459477314L, + 6995361206199059042L, + -4868650397665721927L, + -7208287292799671945L, + -3899683041439439017L, + 1521234411290838670L, + 5267471567701155516L, + 6474031661344396260L, + 4283176820990066383L, + -774826789342914073L, + 4335739136054102737L, + 200896861914240508L, + -4316420436327989620L, + -5088641514239825154L, + 5164519541776509316L, + 2219746828642761402L, + 3587472414755725088L, + -3488503791590966004L, + -1652046437211338111L, + -5535426239533412177L, + -3602265696983958223L, + -4567427711302233998L, + 8184240716274055400L, + -5266269477414042060L, + -7324103519668272668L, + 229999798703974345L, + 7096405761766463580L, + -6255709187415618861L, + 852735384705532175L, + -8938214114308238198L, + 8963621340924508593L, + 9112541540378925595L, + -4616697869335781648L, + -1233934456967866939L, + -4077001463173053748L, + -6419528926392839608L, + 1929390749779564956L, + -7253316895888692088L, + 3527041640449918221L, + -7080491663870455048L, + -7454823183023009856L, + -6713602407554956640L, + -5298856948360600322L, + -1501770146154973327L, + -3425534612569530048L, + 8395223338644809391L, + -4742678068980964529L, + 1652567688904060596L, + 5564504478001751639L, + -8517554112392241558L, + 3786868227755834874L, + -5719304763773211634L, + 3763970332575479507L, + 2649812513621696558L, + -4445024488002933964L, + -8450466196049720316L, + 5754528146566703292L, + 4852625517416018587L, + 7311959397744128586L, + -327622418271024417L, + -5089985239000418204L, + -4480294659534985688L, + -1294989405694625777L, + -615947055237665163L, + -4568269373826433084L, + -6647170598113447270L, + -2205400148055461188L, + -2960875377488314259L, + -7802864814797980125L, + -4662829720569086630L, + 2546408082472556554L, + 890804262993354031L, + -8226401715675614014L, + -8917275821815880727L, + 2477618749365003865L, + 8418269367864851601L, + 4662094108308307351L, + -8118793192420184206L, + 6846264423372553523L, + -7942173008166231500L, + -4108512744107291799L, + -7904090155421027898L, + 5523466200613751305L, + -2953379233731225425L, + -1197095549386947091L, + 6045846757134608180L, + -3707869269183903522L, + 2779236905743216135L, + -361676587843055307L, + -2635261306415357726L, + -6509798004878518435L, + 1863587909403013988L, + -7520580316527163576L, + -6379291317211929448L, + -7620905891725098001L, + -2465551527582106307L, + 7241964578148990184L, + -6311322781101340202L, + -3020667296869548603L, + 8216782627512460387L, + -2692182243233829563L, + 1747175548503678565L, + -8885656099747617845L, + 522291218856276218L, + 6283744457032450774L, + 916230451834982654L, + -4089965662770677423L, + -8903058414982940070L, + -3738198241317312383L, + 1445085914657575113L, + -2012273464670594509L, + 6404077030013937454L, + 1329465815301186919L, + 4635873553023090471L, + -5377753772517225420L, + 1015019521353160404L, + -1665992354319528315L, + 9012340776556375011L, + 5778123565462793861L, + 8530605005049046593L, + -4591714514116980507L, + -4494594919048493483L, + 1893166869054693141L, + -9061649457570254120L, + 2914267276964910135L, + -6284492017246979138L, + -7055505827569739765L, + -889475583938310148L, + -8187613934134840238L, + -3308687460189573629L, + -897141441007718763L, + -6710963242654816172L, + -5341924825235386471L, + 4347432584948358099L, + 8927713241297101393L, + 2180557435070426802L, + 4579020122958742093L, + -5534158339970490803L, + 2185492605512194012L, + -327633447467916153L, + 9215998522891732804L, + -7912803364675245541L, + -1806233245666346644L, + -9038630050176177334L, + -2192019490984975973L, + -6479398744604567096L, + 6995952040088368841L, + -4309518653977861918L, + 6102791465247431297L, + -5104457163765865537L, + 7861681047136438901L, + -5076301891857452794L, + 1819637793566329678L, + -5361659997421131017L, + -2091157752616506018L, + -3248867894565820843L, + 8380590357118949537L, + -5390027978162823802L, + 4679766642994167265L, + 1808649257049920713L, + 1521853533084038975L, + -3254885160393954675L, + 4676349884210895679L, + 7152105176348873586L, + 4019498085477893861L, + -7688826658849547105L, + 7725487018181678237L, + 2843148296909797321L, + -2111458518911373960L, + -5930988189464757132L, + 2999836080082916584L, + 5258645044061481873L, + -4374901417507719180L, + 5968988542990945295L, + 7063865688418250092L, + -3082390282994194982L, + -1769924709834072774L, + 5156154634139202143L, + -5042052718766755463L, + -3999291805788718223L, + -1650492645962554370L, + -2788399451859036047L, + 7757384865629391019L, + 6764067541394908728L, + -2964620754340212099L, + -8835812450211244550L, + -4330613157254549476L, + 5382312720775017309L, + -8912238112613037874L, + 6729362625991860149L, + 5040339868437664129L, + 1986442221150817249L, + 2833965222715421174L, + 4454879067173589066L, + 4214179707119429897L, + 7969471537580882301L, + 4707712647580178131L, + -6276384029844312381L, + 5003823498704182200L, + -7159224012504849677L, + -6732468713847601045L, + -451150815967949945L, + -3304945333512306051L, + 8721127390513069488L, + -6257492216267905806L, + 6994701391892471561L, + 7369521965253705159L, + -1942957112123842402L, + -1274643128018116059L, + -1580125162564136735L, + 9136185408214755747L, + -2914537383120971740L, + 9209644639937450115L, + 487124280788007393L, + -8177344317197823195L, + 2738707339044517752L, + 8095872149006863063L, + -545157444532302601L, + -936698329718580485L, + -4901388582496778106L, + -1399963386439197980L, + 1690941657066922406L, + -6188898220632922030L, + 182177611176833150L, + -5235331291371493590L, + -7215173511743087678L, + -2940930949094457090L, + -3554616762777959507L, + -1227566774803650594L, + 126409523184734199L, + -5552904319120555059L, + 7352012128947000025L, + 175845163851021692L, + 7689535477863431441L, + 1688817097916176071L, + -8309357218398085711L, + 1143303078449829434L, + 4988650444510350305L, + 989390459273330745L, + -4404786474907964461L, + -6013357091088560707L, + -3369486357840647176L, + -5617919047910994332L, + 7862597641680704753L, + 6153533607628655113L, + -5935817060689825006L, + -4638742470542759160L, + -5170200139486489942L, + -3797462862816231632L, + -7523250579546769374L, + 3432885051112683135L, + -594962147648253627L, + -1635875643285631379L, + 6231350693553808879L, + 7408417052020966543L, + 2762871106861808563L, + -5173631699220114637L, + 5713727412733125037L, + -3899822138441414888L, + 2531424564706126868L, + 2668705972796311220L, + -8505630464979201291L, + 5232417711683756420L, + -6193480636951185723L, + 3997557899298166160L, + -499329436764373579L, + -4168998692140880977L, + -1278702168248437939L, + -4205714015212589720L, + -6075452672774566057L, + 5316851879595668811L, + -856263686801815946L, + 249453684176791550L, + 8631795819413273172L, + -6359854298613460820L, + -4880284840543237455L, + -8505753341883846372L, + 2210511848333928251L, + 7866118606324100230L, + -6686723182606252640L, + -8022317142606681640L, + 2872846752948911332L, + 1462486761827744910L, + -2333698582625662536L, + 2351971687147951698L, + 8780992513024852527L, + -1055703511181057423L, + -5129838204285009330L, + 6019857852521847817L, + 3474804733922603440L, + -3438026173701472540L, + -5014200821131413864L, + 3722183079515657580L, + 4595459098697613986L, + -7273302362390554577L, + -1183243147173106410L, + 1250316480703787335L, + -4036417308378739551L, + -8171241684564025199L, + -1444817278101452987L, + -5149004456737721464L, + -9151361129918396129L, + -3397841654363889387L, + 5939018758065831959L, + -4618833968900085099L, + -4804710050485360752L, + -986147323305919153L, + 8433402046252694868L, + 3402472387886333079L, + 6648721581812913642L, + 7545001534469525767L, + -2159558352983318523L, + -527918061511557161L, + -9097842819427090448L, + 5490764520636435462L, + 8940907420974044282L, + 8065885367294761717L, + 9126781255864608166L, + -7038128550034808274L, + 2129349033611316048L, + 6122145305083854433L, + -3131698705914526997L, + 8513873847555997838L, + 2641185331298884484L, + -3933359261337583276L, + 4455822931565268868L, + 6210597485361343375L, + 48275763469138112L, + -4040150889516064080L, + -380969185514364438L, + 4241813299302917418L, + -1595624218715483276L, + -4776935416378672245L, + -4376925234762941627L, + 4047867035099872744L, + -1360084872964546187L, + 622387020347388700L, + -5131645918980513847L, + 408338571741801931L, + 7363750087346687688L, + 6737473532720012277L, + 2318019708548967324L, + 8771768074500179526L, + 8857646919759472215L, + 2522573097657493641L, + -2423326328890116522L, + 1989746966925038863L, + 7672722008502212941L, + 2140362728746429911L, + -2673802457555972488L, + -1773151482900640326L, + -313068483478418644L, + 5013158890396496539L, + 5482660465451132885L, + 3258472208968020185L, + 4767670779359132511L, + 7693552999338372999L, + -901680228690526025L, + 1089180371118481814L, + 4293375244035886346L, + -1962629080279766201L, + 2222330065043425897L, + 3369405500095244802L, + 2658789151545528727L, + -7774565807858620379L, + 1084326140869671947L, + -5434432268705031901L, + 2180520833581215938L, + 632866827282395242L, + 7401769093998420929L, + -1501945418691678209L, + -6519039992723163516L, + -3237878798648121431L, + 1445316291631581042L, + 9067784747908349955L, + 6720511821996419101L, + -4604090926074340083L, + -1703427890781067435L, + -2332449337351599134L, + -7134581291331345557L, + -100619425730545485L, + -8928331454614465558L, + -5414664566994091947L, + -250253323907790747L, + -4125120859704104205L, + 5265608675113327534L, + -1106440358316798986L, + -3132948339320524042L, + -1769360217727663390L, + -6148228432119684450L, + 5051735026708131735L, + -3084188413564311460L, + 8759728664177720433L, + -4859095946336685737L, + -1886889459731067640L, + -1378480539638315159L, + -9049809243416485286L, + -2000107983033711361L, + 4157120773731364487L, + -1808265212831445402L, + -2196498993493480264L, + -8386935930399696667L, + 4759938096703369345L, + -4118521846188308313L, + 7157295486858813240L, + 4945752308016651452L, + -4173785935384824363L, + 1788529025053697021L, + 3993842499528395149L, + 9171317917249731442L, + -634141534904935122L, + -2072087936990361526L, + -7526214993566150005L, + 6612748581543768045L, + -3336262380081111460L, + 4976550170355560820L, + 8588219279211966004L, + -4599952352051238782L, + -3077807470649213797L, + 3519048410419239281L, + -1269625857054326672L, + -1981810369066884456L, + 3215154362269493852L, + -1785458974914263946L, + -7685571788755122241L, + -842157214814107044L, + -5897864338134155533L, + -6208498518724029718L, + 1499049555982089916L, + -7395915256615735849L, + 2984391195155257274L, + 5877953066484841227L, + 6846689224681680487L, + 3262845941307632598L, + 5343873341106550578L, + 8674160231567510634L, + -8964078304780361510L, + 8508234887302759010L, + 177823134353084724L, + -6206673588147938556L, + -5743358946993952513L, + -4303394514558459612L, + 3274927803723806123L, + -4798523778581238548L, + -570481748089052408L, + -3841292296997736004L, + 6731855287357772628L, + -7228244941482034575L, + -2491894868983308234L, + 151002941274804308L, + 6365761415219096791L, + 6910374953287400988L, + -8244739115056188084L, + 7312238168197737958L, + 7043896837953553432L, + -105689371098164936L, + -3281826222318725416L, + -5392584437397907545L, + -1244502770939334171L, + 1422952733642352893L, + -781084903411999364L, + 1396690387514113203L, + -8234418537024402963L, + 933069852671849324L, + 3458378457074859210L, + -432385914044143895L, + -333866867497008084L, + -5703273811341863097L, + -2034540751574753942L, + -2369557092226975438L, + -815026134899265013L, + -7959365582485730906L, + -7197967434421910831L, + 4747509881653331798L, + 653308083545458473L, + 5930493565363152735L, + 4681031764662240390L, + 6800487255255275529L, + 2997868047200386085L, + -4012551584799863895L, + -2732276893078481698L, + -6020710793223976880L, + -4359477391069411647L, + -9021880775816161346L, + 6353329025823001408L, + 2805319525008521714L, + 5679548538811076916L, + -6219297722635931220L, + -8841573986244661336L, + 8963781793551427953L, + 2688506298906176650L, + 6141741081705776696L, + 2510363714831351328L, + -2730397005289452736L, + 7708495123904590946L, + -632248182436338500L, + -5234821280863028627L, + 1321223421208197172L, + 5864841446223183074L, + -5988460782579658037L, + -8225052281044207214L, + -897540494473733225L, + 8590474636782421992L, + 7220132770424705042L, + -9106622746426894075L, + -3585709112504182555L, + 7808697748897822522L, + -4089854074839215479L, + 6016223108476798945L, + -6597172736630482691L, + -2193801513557418184L, + 5825159972581893620L, + 4631846790359335398L, + -5532611793901955549L, + -5243152382106090709L, + -127459936222352081L, + 6091495647920317970L, + 6462841941099889780L, + -4575635345767708116L, + -2542164493227712148L, + -305478661809303004L, + -4059150405046622549L, + -5381054086283578893L, + 7191490357105815377L, + 3276929466127581069L, + 2009085051555744551L, + 3249445681007134225L, + -8121229117439800671L, + 3440037568412847743L, + 3280179938427916363L, + 1442329761432187844L, + -1693017785953323849L, + -3408752277115922281L, + -3038837448636151594L, + -3070429694929466029L, + -7559544014133244350L, + 2583256147707906484L, + 8809049921046234748L, + 8707285529402118928L, + 680585173321551184L, + 2835422586302063689L, + -2367902852764733088L, + 4311754893046855300L, + -7420248434161482753L, + -115331812692054874L, + 932066338714068818L, + -8023806876384453665L, + 3566420863959396435L, + 4981613369266357307L, + -3434457476282205941L, + 4903586440989717216L, + 3268581766723018296L, + -6679520660856856176L, + -5331329368963679157L, + -2266666248595158753L, + -8523119193122881242L, + -55424956038138295L, + -9070536805481137606L, + 5417874584175861223L, + -9170990702439119877L, + -2874187966968250082L, + -2946382889610762149L, + 4460563949925001083L, + 208629763415621209L, + -2006752850050214804L, + 4078329933745202367L, + -6003178253606500673L, + -1901357459835262850L, + -8628316773608528907L, + -2367045297086306897L, + 5181249700081074386L, + -4589928625788551233L, + -2552920600683065276L, + 3839074001010260393L, + 6062571583983586246L, + 3105281105213899486L, + -8099385440700840978L, + 4787643747225137633L, + -8984875174291612426L, + 4913083880029400303L, + 6268216711282604489L, + -9161084900657602886L, + 4091506170626504784L, + -6137301573374744154L, + 862946098808666372L, + -6257228414093693534L, + 846885534512613336L, + -8079328287598987503L, + -6720900737415180224L, + 1285878208148563529L, + 7631267414265336249L, + -2101551039318119517L, + 5109001452480742834L, + 3045563723015329655L, + -2678263607699919634L, + -6111470810863893821L, + -62607678110828373L, + 2055784805590000566L, + 1529635868940897778L, + 7944938393711537630L, + -8622354108627238341L, + 400616186093007467L, + -3365668985765229920L, + 520796926667976058L, + 102953245028782442L, + -2887814565519713483L, + 1134845382723719106L, + 9165308674806362050L, + -6744097273442400118L, + 6792112760482467418L, + -2608343247634721333L, + -4300634750668796357L, + 9114849223412999163L, + 3292520868553201409L, + 8990457701612625656L, + -8604807838878366041L, + 6771571915702855913L, + -2596622766084861700L, + -1646084290072088508L, + 1986205531231129502L, + -7397245895787143030L, + 1322416902629630467L, + 8798541050009010963L, + -2603841395104921386L, + -543569387127414242L, + 984277979951833313L, + -3660009424046808871L, + -8594713258206394011L, + 8481462325069318424L, + -7693778854396921111L, + -3466292502757840479L, + -2782730956760988243L, + 2144829447800020843L, + 1822306312783027271L, + -6176295933444085182L, + 622474367537194108L, + -4672048499304291212L, + -4264273507669187343L, + 6547219371359541315L, + 307228520032121068L, + -6000079446917495846L, + 1421275154031788543L, + -5016167630802770982L, + -8153331626666077741L, + 4942105349496831629L, + 3433248069013654310L, + -2222196715022867294L, + 1813002790841082845L, + -3166716117255484472L, + -9054518662678110779L, + -7366837763863382746L, + 1821322667002800477L, + -6699279961062916425L, + 5275413951856993906L, + -1764403036698451877L, + -6814217963826368587L, + 7436121024271456880L, + 8020503156016080684L, + 4790388985973217959L, + 1217850670627339453L, + 9024348854253136643L, + 1103129819330605922L, + -2166392621148129624L, + 1180647242684910729L, + -1356076635533405843L, + -6621817644273909238L, + 8889272575079464367L, + 4253064062765640293L, + -8444342477389972075L, + -4449332965293453838L, + -4037054741244914652L, + -5783630812876862786L, + -6227123841055454074L, + 2689340898385899414L, + -5298687834900317834L, + -5771269026024081892L, + 1945144907664070561L, + -2548379487047027869L, + -4846198189662238716L, + 6383035859800179563L, + -538840917214433039L, + 8270516200955665520L, + -8600518090590687029L, + 3805661707968319824L, + 7599817584154307234L, + -3646938568457564007L, + 43016748520311967L, + 3409116355300614893L, + 621933859667984230L, + 4420539797901766919L, + -8854667100425996404L, + 7203838388356217445L, + -7264835226236053678L, + -1623402918890722788L, + -4166106671946901643L, + 8889077380182099507L, + 8937812779969367487L, + 4083244217264466556L, + 7823919447681612722L, + -385459494499317144L, + -5883272230680561812L, + 6356338096717516045L, + 9162899879168759439L, + 566477718171182844L, + 5138116499374346600L, + -8162099721989626792L, + 2871419627484181402L, + 4549390537257157879L, + -2450300817394156370L, + 7914639949613314474L, + 860572809253792281L, + 2292560778148293412L, + -7502514745528454484L, + -6882165832291626199L, + -2630674516935294102L, + -4989794580249597060L, + -7513651950755561937L, + 4804536116066169381L, + -5242688622696191670L, + 8047321759875327873L, + -3677209646627471284L, + 6980331724177633705L, + -375074456792592810L, + -6802449435897247678L, + -1628562059596464092L, + 8113462089103701362L, + -3970435268208640319L, + -9097918839183737600L, + 6199140712580348865L, + -268991411330185044L, + -7817073335811580945L, + -3405223752470266629L, + 7993791576935207402L, + 5192774131052489482L, + -9042927321514383766L, + -3601662122081534094L, + 4841841972164327977L, + -1645688674582329230L, + 7159999496075283486L, + -7405132443615822400L, + -3717231289253565466L, + 2918520769168028237L, + -1260804183044051163L, + 8154917047376864752L, + 5508346499230105531L, + 3285997221882934909L, + -5617134513664899328L, + 8293867188447369346L, + -3882977634293431140L, + 1239307736392879380L, + -8924851511568278673L, + -1622087619217032532L, + -5551432630671196153L, + -1121763370203524511L, + 551938970558940490L, + 448453096366444138L, + 5667305190458742300L, + 4539597042043946745L, + 5829786741944860299L, + 3393352605677422507L, + 335053384967789388L, + 4394222496211014534L, + 5370000130739018087L, + -565706613123683753L, + -7833497599449750817L, + -3437882830797020390L, + 4937862675193204437L, + 5959554141150583384L, + 3983730657745060070L, + -2467280586303360795L, + -335334767324786992L, + -640382658335040542L, + -6577797313708187062L, + 1125349079636120123L, + -494879484631175552L, + -5623945463935727777L, + -3970027725779406711L, + -8493400026672732241L, + -311293892634841311L, + 6355980595541216637L, + -5751497682715332938L, + 2347741401598364925L, + -4809577486191269354L, + 1420282983140681264L, + 3613315133783948228L, + 8625254293652687419L, + 7531382631561216614L, + 5399763597085607760L, + 3035446121449853380L, + -2120112973020043286L, + 480192923742041432L, + -2548797010939265844L, + -3405974478077804102L, + -133708079963712608L, + -337250121171329984L, + 4042336883248424281L, + -5364750416296539339L, + -6498306095021896398L, + -7473497501035559608L, + 1723304923372711161L, + 5006605643417679342L, + -909630909226495535L, + 4651967258997819637L, + -2492450197158626287L, + 8848922133698826227L, + 6782108621218678042L, + 4567479157936435262L, + -820689158472515069L, + 4826415566140008821L, + -2484634481640370398L, + 1380433635719727570L, + 8147033694125853433L, + -3881420496323039737L, + -5072661488520121646L, + -1001254897970286729L, + 6441576346453560757L, + -7535835287918290060L, + 7430502536985186200L, + 5108187444240043248L, + 1549419730978779681L, + 7111883894871337879L, + 6796158162775215639L, + 2516639939991012468L, + -2371674177998310802L, + 1127854323859071735L, + -8295387485661924306L, + 1253693892107448444L, + -354249102833783868L, + 1065848432473299948L, + 4980932879340301589L, + -3265506302710279538L, + 1321586933496286980L, + -4844842473063803960L, + -4204298827240721647L, + -3118913691980453704L, + 7305336767320557495L, + -6798785057541149778L, + 8746540548113783399L, + -7969167725986709018L, + 8609211018983958021L, + -7231030245443353922L, + 5692294488862404752L, + -5761197062576580840L, + -5894104633667262135L, + -1372322724071052152L, + -1152616426443151651L, + 935972424443347664L, + 8940890555228973330L, + -619270121883985361L, + 8372920364579516256L, + 4398889684895596727L, + -4160078105340506886L, + 17822379882525818L, + -1430879876106006468L, + 3128763795393100346L, + 607666137432825035L, + -766289326504346177L, + -4462174050261663777L, + -1140803182508002260L, + 1035794337970190842L, + 299393203454704382L, + 7734246045329515707L, + 6361639674133231345L, + -4159331747805036027L, + -4615813274428812655L, + 3873955101764325164L, + -6849074412332003603L, + -8511457087328374957L, + 1188632971701951322L, + -4073667337443196875L, + 4905058734702399313L, + -4717225456603964250L, + 5342494502015340877L, + -1341838399813369350L, + -1184900213109944408L, + 7269941727655174395L, + -8379459598706879314L, + 3162473609960755880L, + -3008200309695401191L, + 2351068467933459341L, + -71569529145854359L, + 3900859699454157168L, + 7000831594956186274L, + 4124542402944063388L, + 517836136499145469L, + -3563369622913903581L, + -6131810259721881352L, + 2478930569265994206L, + -7335894002456063877L, + -1852552332759896185L, + -7661455803549448534L, + 4220258643753458017L, + -2576514654123627237L, + -4329614475513280706L, + -6312701748516438716L, + -8712455751362790038L, + }; +} diff --git a/src/test/resources/net/openhft/chronicle/algo/hashing/reference/XxHashTest.java b/src/test/resources/net/openhft/chronicle/algo/hashing/reference/XxHashTest.java new file mode 100644 index 00000000..2c5bd220 --- /dev/null +++ b/src/test/resources/net/openhft/chronicle/algo/hashing/reference/XxHashTest.java @@ -0,0 +1,2141 @@ +/* + * Copyright 2015-2025 chronicle.software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.hashing; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +import java.util.ArrayList; +import java.util.Collection; + +@RunWith(Parameterized.class) +public class XxHashTest { + + @Parameterized.Parameters + public static Collection data() { + ArrayList data = new ArrayList(); + for (int len = 0; len < 1025; len++) { + data.add(new Object[]{len}); + } + return data; + } + + @Parameterized.Parameter + public int len; + + @Test + public void testCityWithoutSeeds() { + test(LongHashFunction.xx(), HASHES_OF_LOOPING_BYTES_WITHOUT_SEED); + } + + @Test + public void testCityWithOneSeed() { + test(LongHashFunction.xx(42L), HASHES_OF_LOOPING_BYTES_WITH_SEED_42); + } + + public void test(LongHashFunction city, long[] hashesOfLoopingBytes) { + byte[] data = new byte[len]; + for (int j = 0; j < data.length; j++) { + data[j] = (byte) j; + } + LongHashFunctionTest.test(city, data, hashesOfLoopingBytes[len]); + } + + /** + * Test data is output of the following program with xxHash implementation + * from https://github.com/Cyan4973/xxHash + *

+ * #include "xxhash.c" + * #include + * #include + * int main() + * { + * char* src = (char*) malloc(1024); + * const int N = 1024; + * for (int i = 0; i < N; i++) { + * src[i] = (char) i; + * } + *

+ * printf("without seed\n"); + * for (int i = 0; i <= N; i++) { + * printf("%lldL,\n", (long long) XXH64(src, i, 0)); + * } + *

+ * printf("with seed 42\n"); + * for (int i = 0; i <= N; i++) { + * printf("%lldL,\n", (long long) XXH64(src, i, 42)); + * } + * } + */ + + public static final long[] HASHES_OF_LOOPING_BYTES_WITHOUT_SEED = { + -1205034819632174695L, + -1642502924627794072L, + 5216751715308240086L, + -1889335612763511331L, + -13835840860730338L, + -2521325055659080948L, + 4867868962443297827L, + 1498682999415010002L, + -8626056615231480947L, + 7482827008138251355L, + -617731006306969209L, + 7289733825183505098L, + 4776896707697368229L, + 1428059224718910376L, + 6690813482653982021L, + -6248474067697161171L, + 4951407828574235127L, + 6198050452789369270L, + 5776283192552877204L, + -626480755095427154L, + -6637184445929957204L, + 8370873622748562952L, + -1705978583731280501L, + -7898818752540221055L, + -2516210193198301541L, + 8356900479849653862L, + -4413748141896466000L, + -6040072975510680789L, + 1451490609699316991L, + -7948005844616396060L, + 8567048088357095527L, + -4375578310507393311L, + -3749919242623962444L, + 888155921178136237L, + -228195649085979072L, + -521095004075279741L, + -2458702038214709156L, + -2792334161285995319L, + 7509323632532862410L, + 46046374822258777L, + -731200582691896855L, + 933917387460394992L, + 5623144551929396680L, + 6456984547425914359L, + -6398540474588876142L, + 1224372500617079775L, + -931727396974525131L, + 979677643219401656L, + -8078270932489049756L, + -92767506898879473L, + 2379112167176776082L, + 2065719310945572007L, + -4972682801816081667L, + -7346559332994187462L, + 4674729779638751546L, + 5844780159702313017L, + 925606237565008152L, + 8164325403643669774L, + 5124005065773312983L, + -4646462236086916483L, + 4733593776494364101L, + -6408850806317360L, + 7405089268865026700L, + -2131704682637193649L, + -592659849139514384L, + -4386868621773355429L, + -2216833672566288862L, + 4022619316305276641L, + -60464713570988944L, + 2416749694506796597L, + 3576590985110933976L, + 3368688771415645536L, + -357157638897078259L, + 3484358739758473117L, + 2078888409435083535L, + 8053093288416703076L, + -4934736471585554038L, + -7784370683223414061L, + -4109284735634941390L, + 5982490102027564625L, + -4991107002810882893L, + 8664747912276562373L, + 8536879438728327651L, + 2358675440174594061L, + 5352236919104495867L, + 6340852522718110192L, + 5075606340464035668L, + -6313168920073458239L, + -6428599582591385786L, + -7278654800402467208L, + -6630626099856243581L, + -7548742438664634646L, + 5514383762309532642L, + -5996126265702944431L, + 4011116741319319261L, + -7289240093981845088L, + 4975257207486779926L, + -3945500877932691916L, + 1973955144068521079L, + 3884425912161913184L, + 7692681977284421015L, + -1616730378439673826L, + 4799493270916844476L, + -6107310582897997679L, + 3643294092300179537L, + 5406040598516899149L, + -3032420409304067208L, + 5044227119457305622L, + 9165032773225506149L, + 7553488247682850248L, + 2247298339072845043L, + 7380491470304042584L, + -456791943260357427L, + -1906500292613319324L, + -4025157985304129897L, + 6167829983725509611L, + -8678196943431064825L, + -636391087313417831L, + 5757999497725839182L, + 8999325347316115948L, + -6042339776328081249L, + 7988836354190359013L, + 2818448030979902104L, + -8484201484113382447L, + -1140175406473847155L, + 3042776987426497381L, + 3147338037480432386L, + 5065714330193756569L, + 8827021486636772242L, + 838335823706922959L, + 481844220820054909L, + 5333474685474667077L, + -3722898251196013565L, + 7909417627390150381L, + 7116148225996109646L, + 7520381989775811302L, + 6045444672904719015L, + 169039646730338133L, + -2144629916252757106L, + -3752608501798118554L, + 8374704774878780935L, + -5830926781667225570L, + 3202139393110256022L, + 4400219135677717216L, + -5663710220155589201L, + -2589002340345751622L, + -8240133511464343390L, + -4036798392879835146L, + 501599054729008501L, + -4851415719238782188L, + 7565157933617774080L, + -6428091359957700043L, + 4081845077806300175L, + -9016659258880122392L, + 7811786097015457596L, + 1357606791019752376L, + 6522211979684949668L, + -3462397075047559451L, + 3075504459164148117L, + 3055992297861390732L, + -7230492327399411047L, + -1128103378253532506L, + 1834607408788151585L, + 7065978976369231860L, + 6566122632438908362L, + -3440855531356735824L, + 6271453770746181891L, + 413365468403580071L, + -8342682158827061522L, + -3713303136987568731L, + -8959326895824091541L, + -2793862582117663595L, + -184756427409317729L, + -7052502019782453427L, + 3666196071825438258L, + 170204095295428634L, + -1880693509859077843L, + 5179169206996749826L, + 2866097700453114958L, + 1859104195026275510L, + 3782323564639128125L, + -6485194456269981193L, + 6761934873296236857L, + 5764605515941066448L, + 597754945258033208L, + -4888986062036739232L, + -6490228233091577705L, + 3234089784845854336L, + -5506883591180767430L, + 1491493862343818933L, + 3232293217886687768L, + -4079803366160739972L, + 4884134040093556099L, + -7274733680156962461L, + 5265680254123454403L, + 1036855740788018258L, + 423439784169709263L, + -3627743032115866622L, + -6311378083791982305L, + -3058076915688265687L, + 5826550132901840796L, + 8049712006832885455L, + 1707844692241288946L, + -3293048440386932248L, + -2458638193238955307L, + 943059295184967928L, + 3899561579431348819L, + -1516862862245909493L, + 4448476568037673976L, + 8738531437146688925L, + -1033913449611929894L, + 733668166271378558L, + 438686375775205249L, + -4325889118346169305L, + -238178883117433622L, + -7972205050662019794L, + -1263398103237492853L, + -8333197763892905802L, + 7796341294364809534L, + -1381767618016537445L, + 2892579485651013970L, + -3376209887503828920L, + -8575120126045607817L, + -1609355362031172055L, + -386138918275547508L, + 4598874691849543747L, + -2961781601824749597L, + -3032925351997820092L, + -4256249198066449735L, + 6712291718681474012L, + -4281614253751277086L, + 3727487933918100016L, + -2744649548868700294L, + 8662377383917584333L, + -9154398439761221404L, + -6895275824272461794L, + 3394857180017540444L, + 2010825527298793302L, + 4894417464710366872L, + -6879244364314087051L, + 83677167865178033L, + -8258406393927169823L, + 5042126978317943321L, + 6485279223034053259L, + 4442956705009100620L, + 316801800427881731L, + 1381431847939703076L, + 5172932759041399062L, + -69656533526213521L, + -5302643413630076306L, + -3956089084400440856L, + 372087412941022771L, + 4711314482928419386L, + 3255220726505012060L, + 8917854303046844847L, + 1116214654602499731L, + 2282408585429094475L, + -9207590323584417562L, + 8881688165595519866L, + 1731908113181957442L, + 3847295165012256987L, + 4457829016858233661L, + 4944046822375522396L, + 3445091217248591320L, + -5055680960069278553L, + -399195423199498362L, + -8109174165388156886L, + 4967185977968814820L, + -5911973391056763118L, + 2239508324487797550L, + -954783563382788523L, + 8523699184200726144L, + 932575865292832326L, + -7491448407022023047L, + 1809887519026638446L, + -8610524715250756725L, + 6158809695983348998L, + 4948400960714316843L, + -4513370424175692831L, + -3955280856263842959L, + 6440233015885550592L, + 8756942107256956958L, + 7895095834297147376L, + 370033091003609904L, + 948078545203432448L, + -8523229038380945151L, + 100794871657160943L, + -2186420796072284323L, + -9221115378196347951L, + 8102537654803861332L, + 5857339063191690550L, + -4554257374958739421L, + 6607496554818971053L, + -778402196622557070L, + -3817535277727878318L, + 3564122000469288769L, + -44446230828995950L, + 1322708749649533240L, + 6150374672341998205L, + -3300275952549095391L, + 5700833512536085850L, + -8559358370491270937L, + 5434443260519512697L, + -8031025173259990945L, + 7117462129248544172L, + 5425177419943569451L, + -7215427371174054838L, + -5728669976971194528L, + -2096361446095323077L, + -4247416835972286805L, + 4912769047482466787L, + 7755341152739082452L, + 6797061233443658471L, + 4089361562209715474L, + 5830701413838808929L, + 5514515889578551370L, + 609334005368729318L, + 177310574483850759L, + -820431153866372784L, + 7188454041446661654L, + 7480194911613035473L, + 4564607884390103056L, + 888496928954372093L, + -5480535802290619117L, + 9100964700413324707L, + 510523132632789099L, + 8249362675875046694L, + 5340321809639671537L, + -4633081050124361874L, + -839915092967986193L, + -7377542419053401928L, + 1820485955145562839L, + 8517645770425584256L, + -1877318739474090786L, + 7674371564231889244L, + -3311130470964498678L, + -880090321525066135L, + -5670998531776225745L, + -8828737503035152589L, + -6029750416835830307L, + -6535608738168818581L, + -550872341393232043L, + 2831504667559924912L, + -4613341433216920241L, + 502960879991989691L, + 576723875877375776L, + -2575765564594953903L, + -4642144349520453953L, + 7939746291681241029L, + 6486356905694539404L, + -9086235573768687853L, + 5369903658359590823L, + 3199947475395774092L, + 8384948078622146995L, + -3365598033653273878L, + -2525526479099052030L, + 2648498634302427751L, + 3715448294999624219L, + -4734466095330028983L, + -8440427851760401644L, + -371198022355334589L, + 8864079431738600817L, + -4205600060099565684L, + 6617166152874298882L, + -6515522971156180292L, + 7254251246745292298L, + -420587237082849417L, + 1190495815435763349L, + -474540026828753709L, + -8150622114536376016L, + -5790621848044235275L, + -2780522220219318167L, + -2991155855957250848L, + 1692932912262846366L, + 8814949734565782733L, + -8746818869495012552L, + 7931250816026891600L, + -7434629709560596700L, + 4388261932396122996L, + 7154847153195510802L, + -2810154398655124882L, + 2601892684639182965L, + 7781574423676509607L, + -6647000723020388462L, + -8679132292226137672L, + -2447013202020963672L, + 3658855631326217196L, + 2176620921764007759L, + 3654402165357492705L, + 4511989090021652156L, + -3254638803798424003L, + 9050506214967102331L, + 922579360317805810L, + 609820949221381248L, + 5723875594772949290L, + 4637721466210023638L, + 6195303339320487374L, + -38202587086649325L, + -2142927092331878341L, + 5355751314914287101L, + -7170892783575760055L, + -7506612729078573199L, + 8645580445823695595L, + 3221950179890871958L, + 1638211443525398634L, + 7356718304253861777L, + -296260062751271549L, + -1790105985391377345L, + -7004118620405119098L, + 7056012094479909462L, + -7673357898031223798L, + -8929502135696203556L, + 7527161467311997998L, + 6182865571027510002L, + -2163310275402596869L, + 6285112477695252864L, + 3703909999924067987L, + 962491298117560533L, + 138936592567072793L, + 6094857527471100960L, + 5914305068838335718L, + -8896724991235492552L, + -2667562314507789198L, + -7456492499188304500L, + -3422709784851063201L, + -1511644999824238281L, + -7130158069449057322L, + 6243266426571961929L, + 2713895636371672711L, + 5765589573821453640L, + 2624585483746388367L, + 3933828437519859601L, + -5664404238108533781L, + 7086393398544811684L, + 1322058227068490376L, + -8232508114671021371L, + -5963804389649678229L, + -3318229976491806899L, + -6261789542948241754L, + 199130260709663583L, + 7521707465510595039L, + 507353862067534334L, + -7737968456769005928L, + -8964687882992257099L, + -7735003539801528311L, + 6989812739838460574L, + -6986289777499051441L, + 1881562796144865699L, + -6077719780113966592L, + -5427071388091979746L, + 1660707436425817310L, + -4338189980197421104L, + 5330934977599207307L, + 4461280425701571033L, + -7426107478263746863L, + 4258305289832328199L, + -8003283151332860979L, + -2500604212764835216L, + -8883941775298564436L, + -5059709834257638733L, + -4582947579039913741L, + 1371959565630689983L, + -1925163414161391371L, + -1180269729544278896L, + -6603171789097590304L, + 8985062706306079731L, + -3588748723254272836L, + -6052032019910018725L, + 6200960040430493088L, + 2146343936795524980L, + 7785948646708747443L, + 4524411768393719400L, + 749211414228926779L, + -163844243342465015L, + 1066801203344117463L, + -3687825939602944988L, + -4873811917429870500L, + -3765115783578949524L, + 3344884226049804020L, + -22793631121165636L, + -5636541624133159076L, + -6201449576244177151L, + -4533734412127714050L, + -2064657727206266594L, + -1325853623186040989L, + -2651306529045029511L, + 903264360879626406L, + 6082283797495873520L, + 6185446819995987847L, + -5727850940826115079L, + 8356646143516726527L, + -7705915341280821272L, + 9137633133909463406L, + 6613483969797411894L, + 8598514961735984460L, + 6805925079991408361L, + 6009403222422527608L, + 2216303622650116705L, + -3736062178532154638L, + -7139008962939637477L, + -1537711200058404375L, + 8896755073380580322L, + -6063426810787442347L, + -3472064301690015285L, + -4568131486464952371L, + -8141256104294687045L, + 5627435360893599536L, + 1136003802967708029L, + 2730027518034735037L, + 1985287040172139729L, + -3643431491383365431L, + -9042919736106376701L, + 8879968900590373568L, + 8504486139877409399L, + 5832665747670146536L, + 4202923651402292496L, + 1738511892080946286L, + 4512683881549777042L, + 9200194457599870145L, + -1948301178705617139L, + 8655715314401162523L, + 412698981651521600L, + -1479274044808688580L, + 2688302549664693359L, + -3059920027366623178L, + -4275753325231806565L, + -8321791698013769889L, + -3678119714812414102L, + -2500922551770832553L, + 9018541633115002061L, + 5713301371152396803L, + 4180584812840471799L, + 3062416401091271879L, + -8125716681035757962L, + -2076056159878596225L, + 8855540523533374738L, + 2402007906402689092L, + 2020584786288649542L, + 1707405964421070701L, + -3681994462249973122L, + -3982567775984742012L, + 7133200226358561844L, + -5270514263562558963L, + 9060760368219219429L, + -6967162372382490281L, + -9094664463528453384L, + -3968518633408880046L, + 8618660189330281694L, + -4668946581954397558L, + -8596433172676363407L, + -1264942061713169049L, + -5309493221793643795L, + -1099320768477039529L, + 8925041285873295227L, + -6809278181760513499L, + -7039439984223885585L, + 6188209901527865226L, + 1487353394192637059L, + 2402097349430126337L, + -3818359601525025681L, + 4123217079279439249L, + -1424515143377220376L, + 1742298536803356877L, + -2836832784751148874L, + -4838603242771410698L, + 2383745618623084414L, + -2790832243316548423L, + -1176683649587660160L, + 1862928178605117401L, + 5208694030074527671L, + 4339841406618876548L, + -7704801448691668472L, + 500068664415229033L, + -2111184635274274347L, + -1387769336519960517L, + -2368660677263980293L, + -4980481392402938776L, + -6856361166068680884L, + 1708658704968066797L, + -9013068514618931938L, + -2616479975851677179L, + 7121103440247327570L, + -7094192881960646061L, + -4042342930006488618L, + 5294323611741266775L, + 5235545113690922502L, + -2562011392475214878L, + -4613304566070234734L, + -3784386310583029381L, + -4526148219816534267L, + -8643470129031767968L, + -4573761335510927866L, + -8255399593563317902L, + -1925488377092111963L, + -1747797357090594237L, + 7292772921748919564L, + 3951718848780851600L, + 5339305877764077075L, + 7889570407201305102L, + -8935437555550449315L, + -1858205318388884024L, + 381779657795494278L, + -3769854251228686168L, + -7957724087073627355L, + 4349540075286824743L, + -2476434494603040708L, + -4506107235113109706L, + -7120863144673563848L, + -8534342596639587598L, + 2205658724629050493L, + 604438195864305027L, + 4530331938860561927L, + -2074141653226683751L, + -1114378227875974007L, + 3377301950002508302L, + 5369356700690664306L, + -1747063224581819445L, + -6320380781966280801L, + -2075443262555773155L, + 1028541493355576591L, + -4694402890123574860L, + -5250660999767019003L, + 3847087895315315136L, + -4448050214964317066L, + -4591316307978008151L, + 4894820902772635901L, + 3088847887353411593L, + -6699208183127463352L, + 4636731998354510780L, + 9095126525233209263L, + 4135373626035182291L, + 3835688804093949701L, + -3490782692819028324L, + -561453348486424761L, + -3329283619698366365L, + 3251154327320814221L, + -8006986328190314286L, + 5856651505286251345L, + -8871425101391073L, + 7806993676637210959L, + 7586479850833664643L, + -7091216108599847229L, + -3410137297792125447L, + -8251963871271100526L, + -8849730915506517177L, + 8400334327557485676L, + 1676125861848906502L, + -8480324002538122254L, + -1402216371589796114L, + 5951911012328622382L, + 8596811512609928773L, + -2266336480397111285L, + -8840962712683931463L, + 4301675602445909557L, + 1843369157327547440L, + 2169755460218905712L, + -1592865257954325910L, + -8763867324602133653L, + -4283855559993550994L, + -7577702976577664015L, + -5152834259238990784L, + 4596243922610406362L, + -4326545138850544854L, + 1480440096894990716L, + 8548031958586152418L, + 6705615952497668303L, + -2915454802887967935L, + -6137002913510169520L, + 2908515186908319288L, + 5834242853393037250L, + -6721431559266056630L, + -7810820823419696676L, + 1954209413716096740L, + 6657013078387802473L, + 2214178984740031680L, + 8789512881373922013L, + 1240231669311237626L, + 8694612319028097761L, + 492180561068515854L, + -6047127535609489112L, + 7436686740711762797L, + -4520261623507558716L, + 938282189116272147L, + 3232025564608101134L, + -5425498066931840551L, + 932123105892452494L, + 9054941090932531526L, + 8066693670021084601L, + 764877609198828864L, + -489112437588815338L, + 4827691353685521957L, + 1948321254606741278L, + 6117773063719937712L, + 4645962658121906639L, + -7846887104148029590L, + 4210795945791252618L, + -8879516722990993098L, + -2621063563373927241L, + 2094675051444850863L, + -8681225697045319537L, + 6072534474938492189L, + 6181923696407824226L, + 5463607676777614919L, + 3708342890820711111L, + 8844501223821777366L, + -1459359143442302680L, + 2225439088478089068L, + -3866259492807347627L, + 5715020051188773955L, + 3922300588924895992L, + -9142841818158905228L, + 2234845285375211931L, + 2466598091809457099L, + -5086614780930363190L, + -59740786891006359L, + 3484340182077240897L, + 5684798394905475931L, + 8492255409537329167L, + 5276601975076232447L, + -723955912320185993L, + 9032937149732310432L, + 2226206333274026280L, + 5631303328800272036L, + 3943832708526382713L, + -3756282686478033644L, + -5407377327559185078L, + 2025162219823732106L, + -8802502232162774782L, + 9039368856081455195L, + 663058667658971174L, + 3624269418844967319L, + 1835338408542062149L, + 6821836507221295281L, + 6273547355770435776L, + -3104373869480308814L, + 1150888014781722836L, + 7638478751521711777L, + -6407096352658729423L, + -2242514077180426481L, + -3181824045541296523L, + -4562287221569080073L, + -5550768647534615669L, + -5786611484859469238L, + -6147722345444149090L, + 3737249616177808079L, + 3401215612108618403L, + -713522925214097648L, + 7938558781452631257L, + -2822931074351003413L, + -6484774850345918944L, + 3384659068511379086L, + 6976459554734427695L, + 4254162229878558339L, + -3312164339867139602L, + 7263045146222903358L, + 4561625003713187235L, + -3350421200373539593L, + -6329267008823047447L, + -6889593333717619051L, + -6470291206680780949L, + -1925391510610223335L, + 4955720513801530785L, + -6515999401129420095L, + -5146900596178823847L, + 2572121582663686783L, + -4958678197003031937L, + -1295912792184970105L, + -8320363273488883198L, + -8213501149234986129L, + -3883775881968950160L, + -8925953418077243474L, + 3199784299548492168L, + -6836506744583692202L, + -5007347279129330642L, + 7387675960164975441L, + -5841389805259238070L, + 6263589037534776610L, + 3327727201189139791L, + 3673450414312153409L, + -1563909967243907088L, + -3758518049401683145L, + 6368282934319908146L, + -6025191831649813215L, + 1223512633484628943L, + -8540335264335924099L, + -8569704496403127098L, + -5712355262561236939L, + -6468621715016340600L, + 7015005898276272746L, + -1037164971883038884L, + -6108649908647520338L, + -6781540054819591698L, + -2762739023866345855L, + -270930832663123436L, + -2387080926579956105L, + -3984603512651136889L, + 2367015942733558542L, + 2997123688964990405L, + -424413420483149165L, + 2906467516125124288L, + 7979917630945955701L, + 2879736983084566817L, + 558436267366797870L, + 6471658168855475843L, + -3453803644372811678L, + 95470628886709014L, + 5666911245054448862L, + 1594133734978640945L, + 3790246368687946045L, + 8636400206261643605L, + 5901994795106283147L, + -6774812279971490610L, + -4622588246534854941L, + 5395884908872287278L, + 7381412950348018556L, + 5461775216423433041L, + 2851500852422732203L, + 1153428834012773824L, + 2567326223464897798L, + 6290362916558214218L, + 6095765709335097474L, + -3526424734043456674L, + -8411274175041022530L, + 7565408328520233290L, + -1318636864706103626L, + 1261242784453012654L, + -472643963000448611L, + -7126293899612852456L, + 5072187962931197668L, + 4775251504230927816L, + -1624676500499667689L, + 2252385971292411863L, + 7908437759266752884L, + -8948829914565397845L, + 5258787823809553293L, + 3885696202809019506L, + -4551784314460062669L, + 5315762970089305011L, + 7218180419200466576L, + 109471822471146966L, + 3901499100759315793L, + -5613018173558603696L, + 5782419706003468119L, + 8285176821902721729L, + -2944182278904878473L, + 8089487615165958290L, + 6934039118340963316L, + 8481603619533191729L, + -6321491167299496492L, + 6441589800192421521L, + 6436057639713571196L, + 6819921695214365155L, + 1185928916708893611L, + 2597068862418243401L, + -7637601550649263782L, + 9129303862479379164L, + 4047905726243458335L, + 6672087858539795207L, + -4841432774404255351L, + 5501215987763227677L, + -5300305896512100453L, + 1635946349436492617L, + -5017459781050596604L, + -7313558338536196566L, + 4625509831332846264L, + -1241826701278444028L, + 2916178164108211239L, + -6947453283344846915L, + 5520544791845620925L, + 5009241392834567026L, + -630825152277572403L, + 6246654103747517292L, + -5632205909016659384L, + -5099826214945383802L, + 2466330894206710401L, + -1463559257726812272L, + 4922422449110036517L, + -4940410396057186660L, + 8835766963654337957L, + -1984334093384497740L, + 5616151800825184227L, + -8442970605804311782L, + -5396399970392474268L, + 2711274356126287353L, + -5090439840321959043L, + 6638617029380445409L, + -6424875729377006548L, + -7243574969986334324L, + -904268348341193502L, + -6196811069886893217L, + -7742123331454617135L, + 1449632469607275832L, + 3212140938119717436L, + 8676942774083692265L, + -6625590425417154859L, + 8720904664575676760L, + 9151723732605931383L, + 7642401923610349184L, + -3454390566366389884L, + -232373658792783206L, + -8933620623437682010L, + 2514068248201398743L, + 6757007617821370359L, + -2870340646674679163L, + 416331333845426881L, + -5319172016123138702L, + 3294412564645954555L, + 2812538484970453169L, + -9128349093860081905L, + 6784456254618976198L, + -2861881330654872638L, + 3912429093271518508L, + -2562542119887175820L, + 4835616088583228965L, + 427639171891209425L, + 2590582080178010045L, + -6288067880951692635L, + -3204510905067065501L, + 9008426291442999873L, + -4085962609397876083L, + -3786041297813905157L, + -6006475053574578261L, + -6174022276199807178L, + 7958957647277035097L, + 2915785807118517755L, + 2139592530283433011L, + -8562048562533248017L, + -4991735207930685025L, + 393144860250454082L, + -5852177196425420458L, + -2652303154023739579L, + 2079679586901234739L, + -1386526064824772584L, + 1574420554361329695L, + -855542130447493508L, + 8291940350733154044L, + -5330200233059892402L, + 5140782607921164290L, + -977254437067235218L, + -261520846651909307L, + -7369143208070837455L, + -4728766390712852111L, + -8572213434879266955L, + -6754813768712497692L, + 7946121307356573089L, + 504268959085012646L, + -5536654029698676818L, + -6021520522792328781L, + 6968613512520500871L, + 4029920623217569312L, + 2738878342460920492L, + 4562432005481165726L, + -1279037845195368028L, + 1746645308450474697L, + 2538150989161378915L, + 2012299649948738944L, + -3997559675475377347L, + -5939431505669672858L, + 2077103722387383456L, + -6188261335534632204L, + 8772504603740967633L, + -1653698997940568281L, + 1676948989756529271L, + 2377579815165102226L, + -2667481192445387240L, + -5498860615033631762L, + -2490865541169744469L, + -1233441883399707566L, + 5445263795307566596L, + 2288458809413275798L, + -5908274826918996877L, + 2909363406069168415L, + 2376032171261335687L, + -5215189045919902574L, + -6083327007632847329L, + 2462785604224107327L, + -6684045035730714275L, + 2409356208468676804L, + 2814747114160772803L, + -4529204412661254980L, + -8437511853472556883L, + 1819323657613892915L, + 6862685309651627151L, + -9210337863564319258L, + -3641041551811494963L, + -6791020794026796740L, + -5261661996953805298L, + -1953516254626596632L, + -5901591005960707793L, + -7413695905040596911L, + 2952256922297384020L, + -8427771021447591769L, + -6920139339436245233L, + 2967149838604559395L, + -3253499104068010353L, + -8473804925120692039L, + -3561285603521886085L, + -4453849179065102447L, + 2050092642498054323L, + -5626434133619314199L, + 7995075368278704248L, + 7685996432951370136L, + -8037783900933102779L, + 4601459625295412851L, + -4491938778497306775L, + -9089886217821142309L, + -3947191644612298897L, + 1364225714229764884L, + 2580394324892542249L, + -3765315378396862242L, + 6023794482194323576L, + -662753714084561214L, + 3080495347149127717L, + 911710215008202776L, + -803705685664586056L, + -6101059689379533503L, + -2122356322512227634L, + 8012110874513406695L, + -4158551223425336367L, + 8282080141813519654L, + 4172879384244246799L, + 708522065347490110L, + -6997269001146828181L, + 1887955086977822594L, + 8014460039616323415L + }; + + public static final long[] HASHES_OF_LOOPING_BYTES_WITH_SEED_42 = { + -7444071767201028348L, + -8959994473701255385L, + 7116559933691734543L, + 6019482000716350659L, + -6625277557348586272L, + -5507563483608914162L, + 1540412690865189709L, + 4522324563441226749L, + -7143238906056518746L, + -7989831429045113014L, + -7103973673268129917L, + -2319060423616348937L, + -7576144055863289344L, + -8903544572546912743L, + 6376815151655939880L, + 5913754614426879871L, + 6466567997237536608L, + -869838547529805462L, + -2416009472486582019L, + -3059673981515537339L, + 4211239092494362041L, + 1414635639471257331L, + 166863084165354636L, + -3761330575439628223L, + 3524931906845391329L, + 6070229753198168844L, + -3740381894759773016L, + -1268276809699008557L, + 1518581707938531581L, + 7988048690914090770L, + -4510281763783422346L, + -8988936099728967847L, + -8644129751861931918L, + 2046936095001747419L, + 339737284852751748L, + -8493525091666023417L, + -3962890767051635164L, + -5799948707353228709L, + -6503577434416464161L, + 7718729912902936653L, + 191197390694726650L, + -2677870679247057207L, + 20411540801847004L, + 2738354376741059902L, + -3754251900675510347L, + -3208495075154651980L, + 5505877218642938179L, + 6710910171520780908L, + -9060809096139575515L, + 6936438027860748388L, + -6675099569841255629L, + -5358120966884144380L, + -4970515091611332076L, + -1810965683604454696L, + -516197887510505242L, + 1240864593087756274L, + 6033499571835033332L, + 7223146028771530185L, + 909128106589125206L, + 1567720774747329341L, + -1867353301780159863L, + 4655107429511759333L, + 5356891185236995950L, + 182631115370802890L, + -3582744155969569138L, + 595148673029792797L, + 495183136068540256L, + 5536689004903505647L, + -8472683670935785889L, + -4335021702965928166L, + 7306662983232020244L, + 4285260837125010956L, + 8288813008819191181L, + -3442351913745287612L, + 4883297703151707194L, + 9135546183059994964L, + 123663780425483012L, + 509606241253238381L, + 5940344208569311369L, + -2650142344608291176L, + 3232776678942440459L, + -922581627593772181L, + 7617977317085633049L, + 7154902266379028518L, + -5806388675416795571L, + 4368003766009575737L, + -2922716024457242064L, + 4771160713173250118L, + 3275897444752647349L, + -297220751499763878L, + 5095659287766176401L, + 1181843887132908826L, + 9058283605301070357L, + 3984713963471276643L, + 6050484112980480005L, + 1551535065359244224L, + 565337293533335618L, + 7412521035272884309L, + -4735469481351389369L, + 6998597101178745656L, + -9107075101236275961L, + 5879828914430779796L, + 6034964979406620806L, + 5666406915264701514L, + -4666218379625258428L, + 2749972203764815656L, + -782986256139071446L, + 6830581400521008570L, + 2588852022632995043L, + -5484725487363818922L, + -3319556935687817112L, + 6481961252981840893L, + 2204492445852963006L, + -5301091763401031066L, + -2615065677047206256L, + -6769817545131782460L, + -8421640685322953142L, + -3669062629317949176L, + -9167016978640750490L, + 2783671191687959562L, + -7599469568522039782L, + -7589134103255480011L, + -5932706841188717592L, + -8689756354284562694L, + -3934347391198581249L, + -1344748563236040701L, + 2172701592984478834L, + -5322052340624064417L, + -8493945390573620511L, + 3349021988137788403L, + -1806262525300459538L, + -8091524448239736618L, + 4022306289903960690L, + -8346915997379834224L, + -2106001381993805461L, + -5784123934724688161L, + 6775158099649720388L, + -3869682756870293568L, + 4356490186652082006L, + 8469371446702290916L, + -2972961082318458602L, + -7188106622222784561L, + -4961006366631572412L, + 3199991182014172900L, + 2917435868590434179L, + 8385845305547872127L, + 7706824402560674655L, + -1587379863634865277L, + -4212156212298809650L, + -1305209322000720233L, + -7866728337506665880L, + 8195089740529247049L, + -4876930125798534239L, + 798222697981617129L, + -2441020897729372845L, + -3926158482651178666L, + -1254795122048514130L, + 5192463866522217407L, + -5426289318796042964L, + -3267454004443530826L, + 471043133625225785L, + -660956397365869974L, + -6149209189144999161L, + -2630977660039166559L, + 8512219789663151219L, + -3309844068134074620L, + -6211275327487847132L, + -2130171729366885995L, + 6569302074205462321L, + 4855778342281619706L, + 3867211421508653033L, + -3002480002418725542L, + -8297543107467502696L, + 8049642289208775831L, + -5439825716055425635L, + 7251760070798756432L, + -4774526021749797528L, + -3892389575184442548L, + 5162451061244344424L, + 6000530226398686578L, + -5713092252241819676L, + 8740913206879606081L, + -8693282419677309723L, + 1576205127972543824L, + 5760354502610401246L, + 3173225529903529385L, + 1785166236732849743L, + -1024443476832068882L, + -7389053248306187459L, + 1171021620017782166L, + 1471572212217428724L, + 7720766400407679932L, + -8844781213239282804L, + -7030159830170200877L, + 2195066352895261150L, + 1343620937208608634L, + 9178233160016731645L, + -757883447602665223L, + 3303032934975960867L, + -3685775162104101116L, + -4454903657585596656L, + -5721532367620482629L, + 8453227136542829644L, + 5397498317904798888L, + 7820279586106842836L, + -2369852356421022546L, + 3910437403657116169L, + 6072677490463894877L, + -2651044781586183960L, + 5173762670440434510L, + -2970017317595590978L, + -1024698859439768763L, + -3098335260967738522L, + -1983156467650050768L, + -8132353894276010246L, + -1088647368768943835L, + -3942884234250555927L, + 7169967005748210436L, + 2870913702735953746L, + -2207022373847083021L, + 1104181306093040609L, + 5026420573696578749L, + -5874879996794598513L, + -4777071762424874671L, + -7506667858329720470L, + -2926679936584725232L, + -5530649174168373609L, + 5282408526788020384L, + 3589529249264153135L, + -6220724706210580398L, + -7141769650716479812L, + 5142537361821482047L, + -7029808662366864423L, + -6593520217660744466L, + 1454581737122410695L, + -139542971769349865L, + 1727752089112067235L, + -775001449688420017L, + -5011311035350652032L, + -8671171179275033159L, + -2850915129917664667L, + -5258897903906998781L, + -6954153088230718761L, + -4070351752166223959L, + -6902592976462171099L, + -7850366369290661391L, + -4562443925864904705L, + 3186922928616271015L, + 2208521081203400591L, + -2727824999830592777L, + -3817861137262331295L, + 2236720618756809066L, + -4888946967413746075L, + -446884183491477687L, + -43021963625359034L, + -5857689226703189898L, + -2156533592262354883L, + -2027655907961967077L, + 7151844076490292500L, + -5029149124756905464L, + 526404452686156976L, + 8741076980297445408L, + 7962851518384256467L, + -105985852299572102L, + -2614605270539434398L, + -8265006689379110448L, + 8158561071761524496L, + -6923530157382047308L, + 5551949335037580397L, + 565709346370307061L, + -4780869469938333359L, + 6931895917517004830L, + 565234767538051407L, + -8663136372880869656L, + 1427340323685448983L, + 6492705666640232290L, + 1481585578088475369L, + -1712711110946325531L, + 3281685342714380741L, + 6441384790483098576L, + -1073539554682358394L, + 5704050067194788964L, + -5495724689443043319L, + -5425043165837577535L, + 8349736730194941321L, + -4123620508872850061L, + 4687874980541143573L, + -468891940172550975L, + -3212254545038049829L, + -6830802881920725628L, + 9033050533972480988L, + 4204031879107709260L, + -677513987701096310L, + -3286978557209370155L, + 1644111582609113135L, + 2040089403280131741L, + 3323690950628902653L, + -7686964480987925756L, + -4664519769497402737L, + 3358384147145476542L, + -4699919744264452277L, + -4795197464927839170L, + 5051607253379734527L, + -8987703459734976898L, + 8993686795574431834L, + -2688919474688811047L, + 375938183536293311L, + 1049459889197081920L, + -1213022037395838295L, + 4932989235110984138L, + -6647247877090282452L, + -7698817539128166242L, + -3264029336002462659L, + 6487828018122309795L, + -2660821091484592878L, + 7104391069028909121L, + -1765840012354703384L, + 85428166783788931L, + -6732726318028261938L, + 7566202549055682933L, + 229664898114413280L, + -1474237851782211353L, + -1571058880058007603L, + -7926453582850712144L, + 2487148368914275243L, + 8740031015380673473L, + 1908345726881363169L, + -2510061320536523178L, + 7854780026906019630L, + -6023415596650016493L, + -6264841978089051107L, + 4024998278016087488L, + -4266288992025826072L, + -3222176619422665563L, + -1999258726038299316L, + 1715270077442385636L, + 6764658837948099754L, + -8646962299105812577L, + -51484064212171546L, + -1482515279051057493L, + -8663965522608868414L, + -256555202123523670L, + 1973279596140303801L, + -7280796173024508575L, + -5691760367231354704L, + -5915786562256300861L, + -3697715074906156565L, + 3710290115318541949L, + 6796151623958134374L, + -935299482515386356L, + -7078378973978660385L, + 5379481350768846927L, + -9011221735308556302L, + 5936568631579608418L, + -6060732654964511813L, + -4243141607840017809L, + 3198488845875349355L, + -7809288876010447646L, + 4371587872421472389L, + -1304197371105522943L, + 7389861473143460103L, + -1892352887992004024L, + 2214828764044713398L, + 6347546952883613388L, + 1275694314105480954L, + -5262663163358903733L, + 1524757505892047607L, + 1474285098416162746L, + -7976447341881911786L, + 4014100291977623265L, + 8994982266451461043L, + -7737118961020539453L, + -2303955536994331092L, + 1383016539349937136L, + 1771516393548245271L, + -5441914919967503849L, + 5449813464890411403L, + -3321280356474552496L, + 4084073849712624363L, + 4290039323210935932L, + 2449523715173349652L, + 7494827882138362156L, + 9035007221503623051L, + 5722056230130603177L, + -5443061851556843748L, + -7554957764207092109L, + 447883090204372074L, + 533916651576859197L, + -3104765246501904165L, + -4002281505194601516L, + -8402008431255610992L, + -408273018037005304L, + 214196458752109430L, + 6458513309998070914L, + 2665048360156607904L, + 96698248584467992L, + -3238403026096269033L, + 6759639479763272920L, + -4231971627796170796L, + -2149574977639731179L, + -1437035755788460036L, + -6000005629185669767L, + 145244292800946348L, + -3056352941404947199L, + 3748284277779018970L, + 7328354565489106580L, + -2176895260373660284L, + 3077983936372755601L, + 1215485830019410079L, + 683050801367331140L, + -3173237622987755212L, + -1951990779107873701L, + -4714366021269652421L, + 4934690664256059008L, + 1674823104333774474L, + -3974408282362828040L, + 2001478896492417760L, + -4115105568354384199L, + -2039694725495941666L, + -587763432329933431L, + -391276713546911316L, + -5543400904809469053L, + 1882564440421402418L, + -4991793588968693036L, + 3454088185914578321L, + 2290855447126188424L, + 3027910585026909453L, + 2136873580213167431L, + -6243562989966916730L, + 5887939953208193029L, + -3491821629467655741L, + -3138303216306660662L, + 8572629205737718669L, + 4154439973110146459L, + 5542921963475106759L, + -2025215496720103521L, + -4047933760493641640L, + -169455456138383823L, + -1164572689128024473L, + -8551078127234162906L, + -7247713218016599028L, + 8725299775220778242L, + 6263466461599623132L, + 7931568057263751768L, + 7365493014712655238L, + -7343740914722477108L, + 8294118602089088477L, + 7677867223984211483L, + -7052188421655969232L, + -3739992520633991431L, + 772835781531324307L, + 881441588914692737L, + 6321450879891466401L, + 5682516032668315027L, + 8493068269270840662L, + -3895212467022280567L, + -3241911302335746277L, + -7199586338775635848L, + -4606922569968527974L, + -806850906331637768L, + 2433670352784844513L, + -5787982146811444512L, + 7852193425348711165L, + 8669396209073850051L, + -6898875695148963118L, + 6523939610287206782L, + -8084962379210153174L, + 8159432443823995836L, + -2631068535470883494L, + -338649779993793113L, + 6514650029997052016L, + 3926259678521802094L, + 5443275905907218528L, + 7312187582713433551L, + -2993773587362997676L, + -1068335949405953411L, + 4499730398606216151L, + 8538015793827433712L, + -4057209365270423575L, + -1504284818438273559L, + -6460688570035010846L, + 1765077117408991117L, + 8278320303525164177L, + 8510128922449361533L, + 1305722765578569816L, + 7250861238779078656L, + -576624504295396147L, + -4363714566147521011L, + -5932111494795524073L, + 1837387625936544674L, + -4186755953373944712L, + -7657073597826358867L, + 140408487263951108L, + 5578463635002659628L, + 3400326044813475885L, + -6092804808386714986L, + -2410324417287268694L, + 3222007930183458970L, + 4932471983280850419L, + 3554114546976144528L, + -7216067928362857082L, + -6115289896923351748L, + -6769646077108881947L, + 4263895947722578066L, + 2939136721007694271L, + 1426030606447416658L, + -1316192446807442076L, + 5366182640480055129L, + 6527003877470258527L, + 5849680119000207603L, + 5263993237214222328L, + -6936533648789185663L, + -9063642143790846605L, + 3795892210758087672L, + 4987213125282940176L, + 2505500970421590750L, + -1014022559552365387L, + -3574736245968367770L, + 1180676507127340259L, + -2261908445207512503L, + -8416682633172243509L, + 1114990703652673283L, + 7753746660364401380L, + 1874908722469707905L, + 2033421444403047677L, + 21412168602505589L, + 385957952615286205L, + 2053171460074727107L, + 1915131899400103774L, + 6680879515029368390L, + 568807208929724162L, + -6211541450459087674L, + -5026690733412145448L, + 1384781941404886235L, + -98027820852587266L, + 1806580495924249669L, + 6322077317403503963L, + 9078162931419569939L, + -2809061215428363978L, + 7697867577577415733L, + -5270063855897737274L, + 5649864555290587388L, + -6970990547695444247L, + 579684606137331754L, + 3871931565451195154L, + 2030008578322050218L, + -5012357307111799829L, + -2271365921756144065L, + 4551962665158074190L, + -3385474923040271312L, + -7647625164191633577L, + 6634635380316963029L, + -5201190933687061585L, + 8864818738548593973L, + 2855828214210882907L, + 9154512990734024165L, + -6945306719789457786L, + 1200243352799481087L, + 875998327415853787L, + 1275313054449881011L, + -6105772045375948736L, + -2926927684328291437L, + 9200050852144954779L, + 5188726645765880663L, + 5197037323312705176L, + 3434926231010121611L, + -5054013669361906544L, + 2582959199749224670L, + -6053757512723474059L, + -5016308176846054473L, + -2509827316698626133L, + 7700343644503853204L, + -1997627249894596731L, + 3993168688325352290L, + -8181743677541277704L, + 3719056119682565597L, + -7264411659282947790L, + 7177028972346484464L, + -5460831176884283278L, + 1799904662416293978L, + -6549616005092764514L, + 5472403994001122052L, + 8683463751708388502L, + -7873363037838316398L, + 689134758256487260L, + -1287443614028696450L, + 4452712919702709507L, + 762909374167538893L, + 6594302592326281411L, + 1183786629674781984L, + 5021847859620133476L, + -2490098069181538915L, + 5105145136026716679L, + 4437836948098585718L, + 1987270426215858862L, + 6170312798826946249L, + 634297557126003407L, + -1672811625495999581L, + 6282971595586218191L, + 4549149305727581687L, + -5652165370435317782L, + 1064501550023753890L, + -5334885527127139723L, + -6904378001629481237L, + -1807576691784201230L, + -205688432992053911L, + 7621619053293393289L, + 6258649161313982470L, + -1111634238359342096L, + -8044260779481691987L, + 400270655839010807L, + -7806833581382890725L, + -2970563349459508036L, + -7392591524816802798L, + 2918924613160219805L, + -6444161627929149002L, + 6096497501321778876L, + -1477975665655830038L, + 1690651307597306138L, + -2364076888826085362L, + -6521987420014905821L, + -4419193480146960582L, + 3538587780233092477L, + 8374665961716940404L, + 7492412312405424500L, + 6311662249091276767L, + -1240235198282023566L, + 5478559631401166447L, + 3476714419313462133L, + 377427285984503784L, + 2570472638778991109L, + -2741381313777447835L, + -7123472905503039596L, + 2493658686946955193L, + 1024677789035847585L, + -2916713904339582981L, + -4532003852004642304L, + -2202143560366234111L, + 5832267856442755135L, + -261740607772957384L, + 239435959690278014L, + 5755548341947719409L, + 6138795458221887696L, + -7709506987360146385L, + -6657487758065140444L, + -7006376793203657499L, + 6544409861846502033L, + 3171929352014159247L, + 1051041925048792869L, + 2617300158375649749L, + 952652799620095175L, + -576661730162168147L, + -1634191369221345988L, + 4833656816115993519L, + 647566759700005786L, + 2473810683785291822L, + 3005977181064745326L, + -3321881966853149523L, + 7595337666427588699L, + 6004093624251057224L, + -563917505657690279L, + 6117428527147449302L, + -6287297509522976113L, + -4527219334756214406L, + 742626429298092489L, + 3057351806086972041L, + 645967551210272605L, + -4428701157828864227L, + 3236379103879435414L, + -8477089892132066300L, + -6127365537275859058L, + -4052490484706946358L, + -8004854976625046469L, + -3679456917426613424L, + -8212793762082595299L, + -818288739465424130L, + 1358812099481667095L, + 7835987612195254310L, + -3663247409614323059L, + -2931105150130396604L, + 7296136776835614792L, + -2014557408985889628L, + 7267662411237959788L, + 3699280615819277743L, + -212010675469091396L, + -6518374332458360120L, + 145026010541628849L, + 1879297324213501001L, + -7146296067751816833L, + -5002958800391379931L, + 6060682439924517608L, + -432234782921170964L, + -6669688947353256956L, + 7728943532792041267L, + 830911367341171721L, + 3396934884314289432L, + -779464156662780749L, + 2330041851883352285L, + -4783350380736276693L, + -5758476056890049254L, + -7551552301614791791L, + 1253334187723911710L, + -2685018208308798978L, + 5379636036360946454L, + 6154668487114681217L, + -8641287462255458898L, + 4676087643800649558L, + -2405142641398691475L, + 1088685126864246881L, + 6431149082338374041L, + -607357695335069155L, + -720970692129524140L, + 2648766932394044468L, + 8408344790179354573L, + -6193808387735667350L, + 7722524628524697419L, + -6975433852560238120L, + -2925851029234475295L, + -4274458387165211028L, + -8355836377702147319L, + 5278146397877332061L, + 8502098812383680707L, + 2292836642336580326L, + -6127608082651070062L, + 2222301962240611208L, + -1930887695854799378L, + 7640503480494894592L, + 1162652186586436094L, + -1918002592943761683L, + 7648998601717261840L, + -8472603250832757057L, + -988877663117552456L, + 2368458128168026494L, + -6480813811998475245L, + -5896967824416018967L, + -2593783161701820446L, + 6950098417530252598L, + 6362589545555771236L, + 7981389665448567125L, + 3954017080198558850L, + 1626078615050230622L, + 6650159066527969109L, + 697345338922935394L, + -1226816215461768626L, + 8740408765973837440L, + -4194155864629568323L, + 7016680023232424746L, + 6043281358142429469L, + -4201005667174376809L, + 1216727117859013155L, + 6367202436544203935L, + 35414869396444636L, + 3715622794033998412L, + 488654435687670554L, + -2503747297224687460L, + 3147101919441470388L, + -8248611218693190922L, + 970697264481229955L, + 3411465763826851418L, + 9117405004661599969L, + -5204346498331519734L, + -19637460819385174L, + -5039124225167977219L, + 2990108874601696668L, + -2623857460235459202L, + 4256291692861397446L, + 6724147860870760443L, + 3558616688507246537L, + 6487680097936412800L, + -6470792832935928161L, + 4314814550912237614L, + -1292878983006062345L, + 6791915152630414174L, + 5971652079925815310L, + 2557529546662864312L, + 466175054322801580L, + -585216717310746872L, + -2486640422147349036L, + 7212029603994220134L, + 3958995069888972500L, + 4950471855791412790L, + -3721948842035712763L, + -6184503487488243051L, + 4079570444585775332L, + -3952156172546996872L, + 4543894231118208322L, + -1739995588466209963L, + 9155948355455935530L, + 5821980345462207860L, + -2431287667309520417L, + -3890108130519441316L, + -558124689277030490L, + 6079823537335801717L, + 5409742395192364262L, + -2329885777717160453L, + -7332804342513677651L, + 1466490574975950555L, + -420549419907427929L, + -5249909814389692516L, + -5145692168206210661L, + 5934113980649113921L, + 3241618428555359661L, + -6622110266160980250L, + 5048250878669516223L, + 5747219637359976174L, + 2975906212588223728L, + 5730216838646273215L, + -176713127129024690L, + 6734624279336671146L, + 5127866734316017180L, + 7111761230887705595L, + 3457811808274317235L, + 3362961434604932375L, + -1877869936854991246L, + 7171428594877765665L, + -8252167178400462374L, + -6306888185035821047L, + -6684702191247683887L, + -7754928454824190529L, + -1902605599135704386L, + -4037319846689421239L, + 8493746058123583457L, + -8156648963857047193L, + 2051510355149839497L, + -1256416624177218909L, + -3344927996254072010L, + -1838853051925943568L, + 316927471680974556L, + -1502257066700798003L, + -5836095610125837606L, + -1594125583615895424L, + 1442211486559637962L, + -144295071206619569L, + 5159850900959273410L, + 4589139881166423678L, + -7038726987463097509L, + 2886082400772974595L, + 2780759114707171916L, + 5694649587906297495L, + 1260349041268169667L, + 4921517488271434890L, + 644696475796073018L, + 6262811963753436289L, + -6128198676595868773L, + -3625352083004760261L, + -8751453332943236675L, + 8749249479868749221L, + -2450808199545048250L, + -6517435817046180917L, + -3433321727429234998L, + -2591586258908763451L, + 3847750870868804507L, + 6603614438546398643L, + -7598682191291031287L, + 8710261565627204971L, + 4753389483755344355L, + -4645333069458786881L, + -6742695046613492214L, + 643070478568866643L, + -7543096104151965610L, + 7171495384655926161L, + 595063872610714431L, + 3292310150781130424L, + 4326847806055440904L, + -4580020566072794152L, + 3142286571820373678L, + 5530356537440155930L, + 546372639737516181L, + 7401214477400367500L, + 7406531960402873109L, + 3287639667219172570L, + 4977301681213633671L, + 5253257820925174498L, + 2906216636104297878L, + 6142955758238347523L, + -3498651268741727235L, + -5875053958265588593L, + 3896719087169993883L, + -910904726885775073L, + 380107493197368177L, + -4993591912695447004L, + 2970487257212582761L, + 2551762717569548774L, + 953061649962736812L, + 8949739538606589463L, + -2962839167079475801L, + -1375673191272573835L, + 3761793818361866390L, + -389577789190726878L, + 5661262051502180269L, + -6558556411143987683L, + -702798336372315031L, + -336662820551371779L, + 998576401126580155L, + -5945021269112582755L, + 6108533925730179871L, + 2207095297001999618L, + -9042779159998880435L, + -6177868444342118372L, + 6775965402605895077L, + -3788428885163306576L, + 7790055010527190387L, + 3581587652196995358L, + -6176354155561607694L, + -5859381340906321207L, + 395898765763528395L, + 8132967590863909348L, + -3329092504090544483L, + -6785855381158040247L, + 1497218517051796750L, + -5352392845588925911L, + -6271364901230559194L, + 2314830370653350118L, + -7617588269001325450L, + 1423166885758213795L, + 8538612578307869519L, + -61918791718295474L, + -8177103503192338593L, + -4740086042584326695L, + 3677931948215558698L, + 6558856291580149558L, + 2674975452453336335L, + 5133796555646930522L, + 5139252693299337100L, + 7949476871295347205L, + 4407815324662880678L, + -3758305875280581215L, + 6066309507576587415L, + -7368508486398350973L, + -3181640264332856492L, + 6905100869343314145L, + 3677177673848733417L, + 8862933624870506941L, + -8575223195813810568L, + 9178470351355678144L, + 4677809017145408358L, + -1194833416287894989L, + 3436364743255571183L, + -5204770725795363579L, + 560599448536335263L, + -3192077522964776200L, + -751575299648803575L, + 6334581746534596579L, + -8358187891202563300L, + -1462480609823525055L, + 5605961062646987941L, + 4968399805931440889L, + 7968693270782626653L, + -5868205923557518188L, + 1830234928743560617L, + -8435261076693154407L, + 2138416970728681332L, + 8088740745199685138L, + 806532400344230520L, + 1800590379902909333L, + -8909128842071238901L, + -7357495566969170860L, + 3679766664126940553L, + 2060050474865839094L, + 2363972840121763414L, + 525695004292982714L, + -1224842191746529593L, + 7011317848855545003L, + -6337167558180299938L, + -5184688833363785939L, + -8426673387248359061L, + -5035438815930785229L, + 3521810320608058994L, + 4803742557254962242L, + 6623527039545786598L, + -1221475882122634738L, + -3344794405518401087L, + 6510298498414053658L, + 2844753907937720338L, + 90502309714994895L, + -750403235344282494L, + -4825474181021465833L, + -3405519947983849510L, + 3503875590944089793L, + 7286294700691822468L, + 7828126881500292486L, + 8437899353709338096L, + 136052254470293480L, + 1113259077339995086L, + -8244887265606191121L, + 8089569503800461649L, + -1429698194850157567L, + 1575595674002364989L, + 3576095286627428675L, + -7653655285807569222L, + -6053506977362539111L, + -3923855345805787169L, + -8001149080454232377L, + -4382867706931832271L, + 4212860258835896297L, + 4207674254247034014L, + 5519424058779519159L, + -754483042161434654L, + 1434113479814210082L, + -6416645032698336896L, + 5624329676066514819L, + -8229557208322175959L, + 3922640911653270376L, + 7826932478782081910L, + -4862787164488635842L, + 1449234668827944573L, + -1781657689570106327L, + 5442827552725289699L, + 3589862161007644641L, + 4787115581650652778L, + -3512152721942525726L, + -6750103117958685206L, + 5012970446659949261L, + 6797752795961689017L, + 5086454597639943700L, + -7616068364979994076L, + 1492846825433110217L, + 2967476304433704510L, + -8413824338284112078L, + -1319049442043273974L, + -1756090916806844109L, + -9061091728950139525L, + -6864767830358160810L, + 4879532090226251157L, + 5528644708740739488L + }; +}