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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:14:33+00:00 2026-05-28T16:14:33+00:00

I have a counter with a known maximum (called max ). max can be

  • 0

I have a counter with a known maximum (called max). max can be big (actually it will be either 36^40 - 1 or 62^40 - 1).

I want a bijection b from [0..max] to [0..max] with the following property: b(n+1) not easily guessable from b(n).

I am NOT searching for a cryptographically secure function, I just want as much entropy as possible to obfuscate a little the output of a counter.

The function must be doable in PHP. This allows all the functions PHP does.

  • 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-28T16:14:36+00:00Added an answer on May 28, 2026 at 4:14 pm

    I do not think this question is answerable in it’s current form. The criterion

    b(n+1) is not easily guessable from b(n)

    is not well-defined. You have given no metric or quantifiable constraint. Since you go on to write that you are “NOT searching for a cryptographically secure function” and mention in the comments that you “do not truly care that anyone find the function”, it is unclear why you need the bijection at all.

    However, here are some ideas that may help you either find a bijection you’re happy with or clarify your question so others can help.

    Any linear polynomial invertible modulo max will work. That is, a polynomial of the form

    b(n) = a*n + b mod max 
    

    gives a bijection if and only if

    gcd(a,max) = 1 
    

    The easiest case is a=1 and b=0, so that b(n) = n, which seems to satisfy your vague constraints.

    If you want to get fancy with it, you could change a and b often, say be generating a random number (but be sure to check that gcd(a,max) = 1 or you will not get a bijection).

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

Sidebar

Related Questions

I have a need for a counter of type long with the following requirements/facts:
I have a counter variable which will be accessed by multiple threads which will
From Does the program counter always have to change (upon a clock tick)? ,
I have the following HTML/PHP code: <img id=imageViewersrc=someData height= width= alt=></img> <?php //a counter
I have a counter hash that I am trying to sort by count. The
So I have a counter. It is supposed to calculate the current amount of
I have a performance counter category. The counters in this category may change for
So, I am seeing a curious problem. If I have a function // counter
I have a custom performance counter category. Visual Studio Server Explorer refuses to delete
I have created a multi-instance performance counter and I pass it mixed case instance

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.