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 6380759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:18:33+00:00 2026-05-25T02:18:33+00:00

I would like to generate unique 64-bit keys (pseudo)-randomly to identify objects in our

  • 0

I would like to generate unique 64-bit keys (pseudo)-randomly to identify objects in our model. I need the keys to be as unique as possible (minimize the probability of collisions when any N keys are used together) across all users of the system.

Usual GUIDs are out of the question for now because we’re data cheap :). Because I don’t foresee needing more than 1 million keys used in the same context, I would think 64-bit is enough (probability of collision would be about ~10e-7).

As a side-note, I will also need a scheme to fold/hash tuples of those keys into a single 64-bit key that also needs to be well distributed/unique.

Since I need a good (well distributed) hashing function anyway, would it be ok to fold a GUID in half (maybe accounting for the fixed bits in a GUID in some way)? Or is it better to use a local RNG? How would I seed the RNG to maximize uniqueness across space/time of generation? How strong a RNG would I need?

I’m not particularly looking for efficiency (up to a point) but I’d really like to ensure that the probabilities hold up their promise!

  • 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-05-25T02:18:33+00:00Added an answer on May 25, 2026 at 2:18 am

    hash a counter using a fast 128bit cryptographic hash like md5 and then split into two. that will give you “random”, independent values that are 64bits each, and it should be pretty efficient.

    and are you sure you can’t use a simple counter?

    update if you need a distributed solution, simply place a counter on each machine and hash the MAC address of the machine plus the counter. for better throughput use multiple counters per machine, each with a different name (A, B etc), and hash the name too. this is the big advantage of using hashes – you can throw anything in there. just be careful not to have ambiguities (for example, put “-” between each thing you hash, so that a name of “1” plus a count of “23” is not confused with a name of “12” and a count of “3”).

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

Sidebar

Related Questions

I would like to generate a short, unique ID without having to check for
Question 1 We would like to generate a site map for our CMS site
I would like to efficiently generate a unique list of combinations of numbers based
I would like to know if compression algorithms always generate unique output for two
I'm using MongoDB, and I would like to generate unique and cryptical IDs for
For example I would like to generate 5 unique numbers between 1 & 10.
I would like to generate various data types in C++ with unique deterministic names.
I'd like to generate 40-bit values, which are unique and non [so easily] guessable.
I would like an efficient utility to generate unique sequences of bytes. UUID is
I would like to generate a random floating point number between 2 values. What

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.