[String] allow passing a string of custom characters to ByteString::fromRandom#36471
Merged
fabpot merged 1 commit intosymfony:masterfrom May 5, 2020
Merged
[String] allow passing a string of custom characters to ByteString::fromRandom#36471fabpot merged 1 commit intosymfony:masterfrom
fabpot merged 1 commit intosymfony:masterfrom
Conversation
Contributor
| 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
Member
There was a problem hiding this comment.
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]; |
Member
There was a problem hiding this comment.
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
nicolas-grekas
approved these changes
May 5, 2020
Member
There was a problem hiding this comment.
let's go and improve during the betas if there is something to improve
Member
|
Thank you @azjezz. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.