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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:10:18+00:00 2026-05-22T01:10:18+00:00

I have a colleague struggling with a hashing problem. There is a 17-alphanumeric valued

  • 0

I have a colleague struggling with a hashing problem.

There is a 17-alphanumeric valued key (a VIN code) that needs to be converted into a 4 byte value (could be alphanumeric as well). Knowing that those 4 bytes will limit the number of keys, what perfect-hash algorithm would you see for this problem?

  • 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-22T01:10:19+00:00Added an answer on May 22, 2026 at 1:10 am

    After a quick look at Wikipedia, I think you could first “compress” the key, or in other word, you do hash in 2 stages.

    Stage 1: break down the key to individual parts according to the standard, and do customized hash independently.

    Stage 2: Get hashes together, and do a normal hash.

    An naive example:

    If your data is limited to United States, there is only 27 possibility of the first 2 bytes, so the first 2 bytes can be hashed to 0 – 26. (Suppose we get a here.)

    Then suppose other bytes have N possibilities, and can be hashed to 0 – N-1. (Suppose we get b here.)

    The combinational result can be a * N + b. Then do a normal hash (if 26 * N > what 4 bytes can express).

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

Sidebar

Related Questions

I have a colleague who insists that his code doesn't need comments, it's "self
I have a problem that has just come up with a colleague of mine
I have a colleague who is looking into opcode caching/Zend Acceleration (I've always assumed
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can
I'm struggling to understand why the following problem appears. I have an input box
I have a simple query in my code (shown below) written by my colleague.
I have been told by my colleague that void foo(int** p) is used like
I have a running dispute with a colleague. He's written a program that I'm
I have, by accident, exported and imported my colleague's developer identity into Xcode Organizer.
I have SVN bound folder that is copied from my colleague's machine. that folder

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.