22.02.2013, 11:12
little suggestion: this function
doesnt distribute the letters equally to numbers. they both got a 50% chance to get picked, but the alphabet contains 16 more letters than numbers, and it got uppercases aswell - they're less represented compared to the numbers. (10 vs 26*2). for 52 letters, there will be only 10 numbers, caused by the ranodm(2) for taking the first choice...
explained differently: the percentage for a number is 4.2* higher than for 1 letter.
pawn Код:
strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
explained differently: the percentage for a number is 4.2* higher than for 1 letter.