Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:01:43+00:00 2026-06-15T20:01:43+00:00

I have two strings that are hashed into a ulong (using Google’s CityHash) during

  • 0

I have two strings that are hashed into a ulong (using Google’s CityHash) during separate processing stages and now must combine the two hashes into a new hash without significantly increasing the risk of a hash collision.

I know that XOR has some issues (such as Value ^ 0 = Value), but given that the two input values should already be well distributed, I suspect that I can combine the hashes like

ulong hash = hash1 ^ hash2; // hash1 and hash2 are ulong hashes of strings

Is there something wrong in this approach, or is there a better approach that does not add significant computational overhead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:01:45+00:00Added an answer on June 15, 2026 at 8:01 pm

    Based on @GregS’s comments and my own further reading, I believe I’m not seriously degrading the hash distribution by using a simple XOR.

    That is the approach that seems wisest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have two strings that are identical in value, is it guaranteed that
Lets say that I have two strings: The System is in halt state. The
Let's say I have two strings like this: XABY XBAY A simple regex that
I have two arrays, @names and @employees , that are filled with strings that
I have two functions that return simple strings. Both are registered. $.views.helpers({ parseDate: function
I have a basic program that compares two strings : #include <string> #include <iostream>
I have a problem to create a preprocessor macro function, that concatenates two Strings
what i need to do, is have two defined strings that is inputted by
I have two strings in python that I have converted to lists: Seq1 =
I have to two strings that I want to match everything that doesn't equal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.