Skip to content

Commit

Permalink
Merge pull request #207 from dynatrace-oss/komihash-5.10
Browse files Browse the repository at this point in the history
added Komihash 5.10
  • Loading branch information
oertl authored Jan 11, 2024
2 parents 2c9e571 + 46d56be commit c9118d1
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 2,888 deletions.
10 changes: 2 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@
[submodule "reference-implementations/komihash_5_0/komihash"]
path = reference-implementations/komihash_5_0/komihash
url = https://github.com/avaneev/komihash.git
[submodule "reference-implementations/komihash_5_1/komihash"]
path = reference-implementations/komihash_5_1/komihash
url = https://github.com/avaneev/komihash.git
[submodule "reference-implementations/polymur-hash_2_0/polymur-hash"]
path = reference-implementations/polymur-hash_2_0/polymur-hash
url = https://github.com/orlp/polymur-hash.git
[submodule "reference-implementations/komihash_5_7/komihash"]
path = reference-implementations/komihash_5_7/komihash
url = https://github.com/avaneev/komihash.git
[submodule "reference-implementations/komihash_5_8/komihash"]
path = reference-implementations/komihash_5_8/komihash
[submodule "reference-implementations/komihash_5_10/komihash"]
path = reference-implementations/komihash_5_10/komihash
url = https://github.com/avaneev/komihash.git
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@
hash4j is a Java library by Dynatrace that includes various non-cryptographic hash algorithms and data structures that are based on high-quality hash functions.

## Content
- [First steps](#first-steps)
- [Hash algorithms](#hash-algorithms)
- [Similarity hashing](#similarity-hashing)
- [Approximate distinct counting](#approximate-distinct-counting)
- [File hashing](#file-hashing)
- [Consistent hashing](#consistent-hashing)
- [Benchmark results](#benchmark-results)
- [Contribution FAQ](#contribution-faq)
- [ hash4j](#-hash4j)
- [Content](#content)
- [First steps](#first-steps)
- [Hash algorithms](#hash-algorithms)
- [Usage](#usage)
- [Similarity hashing](#similarity-hashing)
- [Usage](#usage-1)
- [Approximate distinct counting](#approximate-distinct-counting)
- [Usage](#usage-2)
- [Compatibility](#compatibility)
- [File hashing](#file-hashing)
- [Usage](#usage-3)
- [Consistent hashing](#consistent-hashing)
- [Usage](#usage-4)
- [Benchmark results](#benchmark-results)
- [Contribution FAQ](#contribution-faq)
- [Python](#python)
- [Reference implementations](#reference-implementations)

## First steps
To add a dependency on hash4j using Maven, use the following:
Expand All @@ -44,7 +54,7 @@ hash4j currently implements the following hash algorithms:
* [final version 4](https://github.com/wangyi-fudan/wyhash/releases/tag/wyhash_final4)
* [Komihash](https://github.com/avaneev/komihash)
* [version 4.3](https://github.com/avaneev/komihash/releases/tag/4.3) (compatible with [version 4.7](https://github.com/avaneev/komihash/releases/tag/4.7))
* [version 5.0](https://github.com/avaneev/komihash/releases/tag/5.0) (compatible with [version 5.1](https://github.com/avaneev/komihash/releases/tag/5.1), [version 5.7](https://github.com/avaneev/komihash/releases/tag/5.7), and [version 5.8](https://github.com/avaneev/komihash/releases/tag/5.8))
* [version 5.0](https://github.com/avaneev/komihash/releases/tag/5.0) (compatible with [version 5.10](https://github.com/avaneev/komihash/releases/tag/5.10))
* [FarmHash](https://github.com/google/farmhash) (farmhashna)
* [PolymurHash 2.0](https://github.com/orlp/polymur-hash)

Expand Down
4 changes: 1 addition & 3 deletions reference-implementations/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ komihash_4_3/komihash_4_3_checksum_config.cpp \
komihash_4_5/komihash_4_5_checksum_config.cpp \
komihash_4_7/komihash_4_7_checksum_config.cpp \
komihash_5_0/komihash_5_0_checksum_config.cpp \
komihash_5_1/komihash_5_1_checksum_config.cpp \
komihash_5_7/komihash_5_7_checksum_config.cpp \
komihash_5_8/komihash_5_8_checksum_config.cpp \
komihash_5_10/komihash_5_10_checksum_config.cpp \
murmur3_32/murmur3_32_checksum_config.cpp \
murmur3_128/murmur3_128_checksum_config.cpp \
murmur3_128/smhasher/src/MurmurHash3.cpp \
Expand Down
8 changes: 2 additions & 6 deletions reference-implementations/calculate_checksums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include "komihash_4_5/komihash_4_5_checksum_config.hpp"
#include "komihash_4_7/komihash_4_7_checksum_config.hpp"
#include "komihash_5_0/komihash_5_0_checksum_config.hpp"
#include "komihash_5_1/komihash_5_1_checksum_config.hpp"
#include "komihash_5_7/komihash_5_7_checksum_config.hpp"
#include "komihash_5_8/komihash_5_8_checksum_config.hpp"
#include "komihash_5_10/komihash_5_10_checksum_config.hpp"
#include "polymur-hash_2_0/polymur-hash_2_0_checksum_config.hpp"
#include "wyhash_final_3/wyhash_final_3_checksum_config.hpp"
#include "wyhash_final_4/wyhash_final_4_checksum_config.hpp"
Expand Down Expand Up @@ -102,9 +100,7 @@ int main(int argc, char *argv[]) {
computeAndPrintChecksum<Komihash4_5ChecksumConfig>();
computeAndPrintChecksum<Komihash4_7ChecksumConfig>();
computeAndPrintChecksum<Komihash5_0ChecksumConfig>();
computeAndPrintChecksum<Komihash5_1ChecksumConfig>();
computeAndPrintChecksum<Komihash5_7ChecksumConfig>();
computeAndPrintChecksum<Komihash5_8ChecksumConfig>();
computeAndPrintChecksum<Komihash5_10ChecksumConfig>();
computeAndPrintChecksum<WyhashFinal3ChecksumConfig>();
computeAndPrintChecksum<WyhashFinal4ChecksumConfig>();
computeAndPrintChecksum<Murmur3_128_ChecksumConfig>();
Expand Down
1 change: 0 additions & 1 deletion reference-implementations/komihash_5_1/komihash
Submodule komihash deleted from 2d9ebd

This file was deleted.

This file was deleted.

92 changes: 0 additions & 92 deletions reference-implementations/komihash_5_1/reference_data.cpp

This file was deleted.

1 change: 1 addition & 0 deletions reference-implementations/komihash_5_10/komihash
Submodule komihash added at 8d5313
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "komihash_5_8_checksum_config.hpp"
#include "komihash_5_10_checksum_config.hpp"
#include "komihash/komihash.h"
#include <cstring>

void Komihash5_8ChecksumConfig::calculateHash(const uint8_t *seedBytes,
void Komihash5_10ChecksumConfig::calculateHash(const uint8_t *seedBytes,
uint8_t *hashBytes, const uint8_t *dataBytes, uint64_t size) const {

uint64_t seed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef KOMIHASH_5_8_CHECKSUM_CONFIG_HPP
#define KOMIHASH_5_8_CHECKSUM_CONFIG_HPP
#ifndef KOMIHASH_5_10_CHECKSUM_CONFIG_HPP
#define KOMIHASH_5_10_CHECKSUM_CONFIG_HPP

#include <string>

class Komihash5_8ChecksumConfig {
class Komihash5_10ChecksumConfig {

public:

Expand All @@ -31,12 +31,12 @@ class Komihash5_8ChecksumConfig {
}

std::string getName() const {
return "Komihash 5.8";
return "Komihash 5.10";
}

void calculateHash(const uint8_t *seedBytes, uint8_t *hashBytes,
const uint8_t *dataBytes, uint64_t size) const;

};

#endif // KOMIHASH_5_8_CHECKSUM_CONFIG_HPP
#endif // KOMIHASH_5_10_CHECKSUM_CONFIG_HPP
1 change: 0 additions & 1 deletion reference-implementations/komihash_5_7/komihash
Submodule komihash deleted from 58e69f

This file was deleted.

This file was deleted.

Loading

0 comments on commit c9118d1

Please sign in to comment.