In the random function of the class HelperStr :
https://github.com/phalcon/cphalcon/blob/6f063edc1b0f1f058724863d71a397564afa7353/phalcon/Helper/Str.zep#L557
Why the number 1 and letters B, G, I, O, Q are not in the case RANDOM_DISTINCT ?
If I'm right, it's not better to use:
let pool = array_merge(
range(0, 9),
range("A", "Z")
);
And I don't understand what RANDOM_DISTINCT does ?
Thanks for your help
I believe it was done for readability. 0 looks very similar to O for instance.
The RANDOM_DISTINCT will generate a string that does not have repeating characters in it.
@niden It's clearer about the letters and numbers missing.
But when I used the function random with the constant RANDOM_DISTINCT.
I had results like that:
U24JAJA5
or
533RTC6D
@jenovateurs I think the method is used to only generate a list of distincted numbers and letters that lookalike. Maybe distinct is not the best word in this case because it's completely removing both. The amount of characters looks a bit too small to have a good distinct use case. It could use some docs love. Thnx for reporting.
@ruudboon Thanks for the additionnal information.