def asciiID(i,one,two,three,four,five):
   if one >= len(chrtb): one=0;two+=1
   if two >= len(chrtb): two=0;three+=1
   if three >= len(chrtb): three=0;four+=1
   if four >= len(chrtb): four=0;five+=1
   pk = chrtb[five]+chrtb[four]+chrtb[three]+chrtb[two]+chrtb[one]
   one+=1
   return pk,one,two,three,four,five

chrtb=[]
for ch in range(33,127): chrtb.append( chr(ch) )
one=0;two=0;three=0;four=0;five=0

for inputInteger in range(1,3000000000):
   pk,one,two,three,four,five = asciiID(inputInteger,one,two,three,four,five)
   print inputInteger,pk


When a ID is formatted with sequencial interger, it is able to convert to characters based on ascii code. Only 5 characters are able to present 7.3 billon IDs (33~126: 94, 94*94*94*94*94).

 

Posted by 옥탑방람보
,