-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from dynatrace-oss/mix-implementations
Mix implementations
- Loading branch information
Showing
20 changed files
with
5,441 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
reference-implementations/komihash_5_7/komihash_5_7_checksum_config.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2022-2023 Dynatrace LLC | ||
* | ||
* 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. | ||
*/ | ||
#include "komihash_5_7_checksum_config.hpp" | ||
#include "komihash/komihash.h" | ||
#include <cstring> | ||
|
||
void Komihash5_7ChecksumConfig::calculateHash(const uint8_t *seedBytes, | ||
uint8_t *hashBytes, const uint8_t *dataBytes, uint64_t size) const { | ||
|
||
uint64_t seed; | ||
memcpy(&seed, seedBytes, 8); | ||
|
||
uint64_t hash0 = komihash((char*) (&dataBytes[0]), size, 0); | ||
uint64_t hash1 = komihash((char*) (&dataBytes[0]), size, seed); | ||
|
||
memcpy(hashBytes, &hash0, 8); | ||
memcpy(hashBytes + 8, &hash1, 8); | ||
} |
42 changes: 42 additions & 0 deletions
42
reference-implementations/komihash_5_7/komihash_5_7_checksum_config.hpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2022-2023 Dynatrace LLC | ||
* | ||
* 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. | ||
*/ | ||
#ifndef KOMIHASH_5_7_CHECKSUM_CONFIG_HPP | ||
#define KOMIHASH_5_7_CHECKSUM_CONFIG_HPP | ||
|
||
#include <string> | ||
|
||
class Komihash5_7ChecksumConfig { | ||
|
||
public: | ||
|
||
uint64_t getSeedSize() const { | ||
return 8; | ||
} | ||
|
||
uint64_t getHashSize() const { | ||
return 16; | ||
} | ||
|
||
std::string getName() const { | ||
return "Komihash 5.7"; | ||
} | ||
|
||
void calculateHash(const uint8_t *seedBytes, uint8_t *hashBytes, | ||
const uint8_t *dataBytes, uint64_t size) const; | ||
|
||
}; | ||
|
||
#endif // KOMIHASH_5_7_CHECKSUM_CONFIG_HPP |
Oops, something went wrong.