This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example; | |
| import java.util.zip.Adler32; | |
| import java.util.zip.CRC32; | |
| public class MySimpleHash { | |
| /** | |
| * Calculate a 64 bits hash by combining CRC32 with Adler32. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import zlib | |
| def get_hash(bytes): | |
| return zlib.crc32(bytes) << 32 | zlib.adler32(bytes) | |
| string = "This is a test string" | |
| hash = get_hash(string.encode()) | |
| print("output:", hash) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example; | |
| import java.nio.ByteBuffer; | |
| import java.nio.charset.StandardCharsets; | |
| import java.util.UUID; | |
| public class UUIDv3WithNamespace1 { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.github.f4b6a3.uuid.factory; | |
| import java.security.SecureRandom; | |
| import java.util.UUID; | |
| import java.util.function.Supplier; | |
| import com.github.f4b6a3.uuid.enums.UuidVersion; | |
| import com.github.f4b6a3.uuid.factory.function.impl.DefaultRandomFunction; | |
| import com.github.f4b6a3.uuid.factory.nonstandard.PrefixCombFactory; | |
| import com.github.f4b6a3.uuid.factory.rfc4122.RandomBasedFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example; | |
| import java.nio.ByteBuffer; | |
| import java.nio.charset.StandardCharsets; | |
| import java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.time.Instant; | |
| import java.util.UUID; | |
| import com.github.f4b6a3.uuid.UuidCreator; |
How to prepare the benchmark files on Linux:
BASE="bench"
mkdir $BASE
cp run.sh $BASE/
cp run.bat $BASE/
cp pom.xml $BASE/
cp README.md $BASE/
Java support
How to prepare the benchmark files on Linux:
BASE="bench"
mkdir $BASE
cp run.sh $BASE/
cp run.bat $BASE/
cp pom.xml $BASE/
cp README.md $BASE/