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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:15:26+00:00 2026-05-12T07:15:26+00:00

Alright, I have some data that I need to assign an int type identifier

  • 0

Alright, I have some data that I need to assign an int type identifier to dynamically.

For example, here’s a sample record.

<Listing>
    <sportcode>AA</sportcode>
    <lgabbr>NL</lgabbr>
    <division>CENTRAL</division>
    ...
<Listing>

There is more data associated with this listing but these are the only fields that I can use to generate the identifier, and I have to use all of them.

How can I put these together to create a UNIQUE identifier?

The only idea I’ve had so far is to concat the the strings together and then replace each char with it’s charcode. This works just fine when I’m encoding just the sportcode (AA = 6565), or sportcode and lgabbr (AANL = 65657876), but when I add division the ID becomes long and unwieldly (AANLCENTRAL = 6565787667697884826576).

Any suggestions on how to make this more consise while still being completely unique?

Edit
Several answers have been submitted that showed how to reverse the process. I think I should mention the process doesn’t need to be reversible at all. Once the number is generated, that is the value that is used by the rest of the application.

Edit again
I’ve decided to go a different way with my solution, although I got some good suggestions. Since the most efficent way to assign the identifiers is to pick them myself instead of generating them, I added an XML doc with the id defenitions and they’re corresponding data. Now the XSLT stylesheet I’m using to create the identifiers can do a lookup in the attached sheet and use the identifiers I assigned. I didn’t want to custom define everything because there are so many posibilities. There are roughly 25 sportcodes, 10/15 lgabbr, and 10 divisions possible. That’s a lot to account for in a stylesheet. Adding the extra XML document consolidates this data outside the stylesheet for easy editing and that is the approach I’m going with (and it works BTW).

Thanks for all your suggestions.

  • 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-12T07:15:26+00:00Added an answer on May 12, 2026 at 7:15 am

    If you limit the characters in strings (such as only UPPER-CASE Latin), you can then use adjust them to base-26 numbers. Such as:

    TEST word will be adjusted to J4IJ, and in decimal 337135.

    Base-26 is using the digits (0-9, A-P)

    With this pattern you can concatenate your string and generate the number.

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

Sidebar

Ask A Question

Stats

  • Questions 248k
  • Answers 248k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm guessing you're asking Django to render a byte string.… May 13, 2026 at 8:54 am
  • Editorial Team
    Editorial Team added an answer Your while loop is looking for EOF which stands for… May 13, 2026 at 8:54 am
  • Editorial Team
    Editorial Team added an answer No, you were right. They're aliases. What that doc was… May 13, 2026 at 8:54 am

Related Questions

So I'm working on a framework-esque system with one of my co-workers. Our current
Ok, so I'm a little confused as to why I can't find this anywhere,
Alright...I've given the site a fair search and have read over many posts about
Alright. So I wanted to use a file written in c in c++. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.