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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:14:22+00:00 2026-05-25T06:14:22+00:00

the topic pretty much describes what we would like to accomplish. a) start with

  • 0

the topic pretty much describes what we would like to accomplish.

a) start with a possible range of integers, for example, 1 to 10000.

b) take any md5 hash, run it thru this algo.

c) result that pops out will be an integer between 1 to 10000.

we are open to using another hashing method too.

the flow would ideally look like this:

string -> md5(string) -> algo(md5(string),range) -> resulting integer within range

is something like this possible?

final note: the range will always start with 1.

if you have an answer, feel free to post just the general idea, or if you so desire, php snippet works too 🙂

thanks!

  • 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-25T06:14:22+00:00Added an answer on May 25, 2026 at 6:14 am

    Since MD5 (and SHA-1, etc.) will give you 128 bits of data (in PHP, you’ll get it in hexadecimal string notation, so you need to convert it to an integer first). That number modulo 10000 will give you your integer.

    Note however that many different hashes will convert to the same integer; this is unavoidable with any sort of conversion to your integer range, as the modulo operation essentially maps a larger set of numbers (in this case, 128 bits, that is numbers from 0 to 340,282,366,920,938,463,463,374,607,431,768,211,456) to a smaller set of numbers (less than 17 bits, numbers from 1 to 100,000).

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

Sidebar

Related Questions

As the topic states - is there any technology that would let me write
Last time I'm exploring PHP pretty much and I was curious if it's possible
I've got pretty much the same problem as this guy: http://www.ruby-forum.com/topic/197440 . I'm trying
The topic generically says it all. Basically in a situation like this: boost::scoped_array<int> p(new
jQuery is pretty much a big selector transversing engine with useful stuff hung on
Title pretty much says it all. When I run msbuild by itself, it displays
I would like to compress a directory using 7-Zip and then download it to
I'm trying to clear up a grey area about this much talked about topic...
I have Camel route that I would like to expose as a REST Web
There are already some pretty good threads on this topic on Stack Overflow, but

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.