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

  • SEARCH
  • Home
  • 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 8896797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:10:09+00:00 2026-06-15T00:10:09+00:00

I have 64-bit unsigned integers (ranging from 0 to 2^63 – 1) and I

  • 0

I have 64-bit unsigned integers (ranging from 0 to 2^63 – 1) and I want to hash them into 32-bit unsigned integers (0 to 2^31 – 1 range).

Data follows Uniform Distribution. Can anyone suggest a hash function that will give a low number of collisions for this distribution (may be with some probability of collision occurrence)?

  • 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-15T00:10:11+00:00Added an answer on June 15, 2026 at 12:10 am

    If the distribution of the is really uniform, then just take the lower n bits (the width of the hash value). This would mean, that worst case you can have 2N-n elements in a bucket. (here N denotes the width of the original number)

    Note: just saw @JanDvorak already suggested this (before my answer), using modulo 2n is equivalent to taking the lower n bits…

    If this is really about 64 bit unsigned integers being hashed into 32 bit unsigned integers, then the correct ranges would be [0;264-1] and [0;232-1], with at most 232 collisions on a single hash. However, in Java, there is no unsigned integer…

    If this is about using the positive half of signed 64 and 32 bit integer values respectively, then your range values are right, and you will still have 232 collisions worst case.

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

Sidebar

Related Questions

I have values that are 64-bit unsigned ints, and I need to store them
I have a count register, which is made up of two 32-bit unsigned integers,
More specifically: I have a sequence of 32 bit unsigned RGBA integers for pixels-
I have a class whose only data member is a 32 bit unsigned integer.
I have two 32-bit unsigned integers in php (the result of crc32() ) and
A C-program is placing what it considers to be 64-bit unsigned integers into a
Say we have an 8-bit unsigned integer n ( UINT8_MAX=255 ); what is the
I have a byte[4] which contains a 32-bit unsigned integer (in big endian order)
Have a bit of confusion here. I added a few objects from a class
I have a bit of code that fits theoretical prediction to experimental data, and

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.