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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:16:59+00:00 2026-05-27T08:16:59+00:00

In my application I use sequences. These are stored in Azure table storage as

  • 0

In my application I use sequences. These are stored in Azure table storage as strings. To update the sequence I get the latest number as a string, convert to a number, add to the number and store it back as the current sequence value. The sequences are used internally as unique keys but they are also visible in URLs to the user so I would like to keep them short.

What I am considering is the idea of having a sequence in base36. In other words 0-Z. Does anyone have any idea how I can get a sequence that is stored as a 4 digit string starting with “0000” and then add one to it to give “0001” right through to “ZZZZ” as the last possible value of the sequence.

  • 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-27T08:17:00+00:00Added an answer on May 27, 2026 at 8:17 am

    This should do it:

    public static string Inc(string s){
    
        System.Func<char,int> v = c => (int)((c<='9')?(c-'0'):(c-'A'+10));
        System.Func<int,char> ch = d => (char)(d+((d<10)?'0':('A'-10)));    
    
        s = s.ToUpper();    
        var sb = new System.Text.StringBuilder(s.Length);
        sb.Length = s.Length;
    
        int carry = 1;
        for(int i=s.Length-1; i>=0; i--){
            int x = v(s[i])+carry;    
            carry = x/36;
            sb[i] = ch(x%36);
        }
        if (carry>0)
            return ch(carry) + sb.ToString();
        else
            return sb.ToString();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why most hibernate application are using sequence for id generation? Why not use the
Can the application use set same char in the XON and XOFF? If yes,
I am wanting to expose some data service endpoints for internal application use and
Somebody said that when your PHP code and application use global variables then it
I'm using Visual Studio to create my installation package. My application use some bitmap
My application makes use of a SQLite database to store the user's inputs. The
An application I use, Mozy Backup , adds its own drive to Windows Explorer
We have an application for use in medical offices, and with CCHIT certification becoming
In my application I use a UIAlertView to display to the user a message
In our Spring application we use clustered Hibernate Search with ActiveMQ which sets up

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.