Register to reply 
How to convert a username to a 2 digit number? 
Share this thread: 
#1
Jan814, 08:52 PM

P: 64

I am trying to figure out how to convert a username into a number between 10 to 99.
It would be preferable that a username will end up being 10 just as much as 99, covering the whole range without a tendency to be low or high.. This method needs to be a simple as possible so that someone can convert their name with little effort. 


#2
Jan814, 08:59 PM

Homework
Sci Advisor
HW Helper
Thanks
P: 12,739

1. Assign numbers to usernames randomly.
2. Assign numbers in order the users show up, starting at 10 and cycling at 99 3. add the ascii values of all the characters together, and take the lowest two digits for the number. ... ... there are so many ways. 


#3
Jan914, 12:50 AM

Sci Advisor
P: 827

If the range was 00~99 then this would be much easier. Base26 to Base10 take last two digits. Edit: ah, scratch it. No matter how many times I modify the algorithm I keep finding holes. 


#4
Jan914, 03:09 AM

Admin
P: 23,528

How to convert a username to a 2 digit number?



Register to reply 
Related Discussions  
Does the first twodigit number have to be 10?  General Math  27  
4 digit number knowing one number  Fun, Photos & Games  2  
Four digit number, digit increasing/decreasing in size  Precalculus Mathematics Homework  2  
(4digit number)*(6digit number) equals a factorial  Fun, Photos & Games  1  
4 digit number...  General Math  4 