Skip to content

Conversation

@chemwolf6922
Copy link

@chemwolf6922 chemwolf6922 commented Nov 30, 2025

  • Incrementally compute the hash instead of repetitively computing the old parts. This reduce the complexity from O(N**2) to O(N).

@yangbaofu007 yangbaofu007 requested a review from BSXXSB December 3, 2025 06:43
for (char c : str) {
hash ^= static_cast<uint64_t>(c);
hash *= 0x01000193;
class StreamHasher {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place the class definition in the header file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This class is not meant to be exposed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update in 7f53e04

uint64_t hash_ = 0x811c9dc5;
};

static std::string get_chunk_description(const mtmd_input_chunk* chunk) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want to distinguish whether it's private by removing it from the header file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not clear on what's this about. Could you please elaborate? Thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update in 7f53e04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants