-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[String] allow passing a string of custom characters to ByteString::fromRandom #36471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes/ |
Deprecations? | no |
License | MIT |
Doc PR | symfony/symfony-docs#... |
632963b
to
184ee9c
Compare
669bb22
to
9f8878f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, here are some early random comments :)
// Worst case, it is 2^k + 1, which means we need (k+1) bits and we | ||
// have around a 50% chance of missing as k gets larger | ||
if ($index < $alphabet_size) { | ||
$ret .= $alphabet[$index]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funny idea: move the function on the base class and allow "characters" to be either code points and/or grapheme clusters, depending on what chunk() returns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go and improve during the betas if there is something to improve
Thank you @azjezz. |