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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:39:48+00:00 2026-05-21T17:39:48+00:00

I am about to write a game that turns barcodes into game items (like

  • 0

I am about to write a game that turns barcodes into game items (like monsters, items, skills a.s.o.). Much like the old “Barcode Battler” game.

Unfortunately I am not very talented in mathematics. What I need is some hints how I could develop an algorithm to “parse” some stats out of barcodes (like Attack points, hit points, …) without making it predictable.

So let’s say I have this 8-digit barcode:
12345678

A friend of mine suggested to hash the barcode with MD5 and a salt but the problem I have with this is that I guess that will produce a lot of collisions. Also then it is difficult in a game designers view to predict chances to get some special attributes.

So does anyone have an idea how I could start here?

  • 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-21T17:39:48+00:00Added an answer on May 21, 2026 at 5:39 pm

    An MD5 hash digest is 128 bits, so there are 2^128 possible hashes, or 340,282,366,920,938,463,463,374,607,431,768,211,456 (3.402823669e+38) possible hashes.

    A barcodes has 12 decimal digits, but one of them is a checksum digit, so we can ignore it. There are 10^11 possible barcodes, or 100,000,000,000 (100 billion) possibilities.

    According to this page: http://www.iusmentis.com/technology/encryption/pgp/pgpattackfaq/hash/#bruteforcemd5, you would need to try at least 2^64 hashes before you would end up with a collision on MD5, which means chances are incredibly small that you’ll end up with a collision using just the set of barcodes.

    The advantage to using MD5 over simply using the bits in the barcode is that for a given company the first part of the barcode will always be the same, and you’ll have to account for that or you’ll end up with a given company producing similar items.

    The disadvantage is that the hashes will be spread all over the possible space of values, so you could end up with a large variety of items and huge gaps.

    The only way to know is to experiment.

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

Sidebar

Related Questions

I'm about to write a little GUI app that will sit in the system
I am about to write junit tests for a XML parsing Java class that
Say that I write an article or document about a certain topic, but the
I'm planning to write an operating system and I don't know very much about
I am using C# to write a method that returns the following information about
How would you write this code? This particular question is about a maze game
I am trying to write a game server that supports multiplayer over a network.
I'm looking to write a small client-server-based text game that handles multiple client connections
I am developing a 3d shooter game that I would like to run on
I am trying to write a small interactive game-like application, where I need to

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.