29.12.2016, 16:19
That gets the decimal though, not the character code which he's after. I suggest you add these little wrappers first:
Then you can easily use these wherever they are needed.
PHP код:
minrandom(min, max)
return random(max - min) + min;
isOdd(number)
return number & 1; // faster than mod
PHP код:
iKey[i] = isOdd(i) ? minrandom('1', '9') : minrandom('a', 'z');