Skip to content
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

Use "more entropy" option when using uniqid() function #176

Merged
merged 1 commit into from Oct 3, 2016
Merged

Conversation

javiereguiluz
Copy link
Member

As you can see in the source code of the PHP uniqid() function when you don't pass true as the second argument, PHP sleeps the application for 1 microsecond (usleep(1))

Symfony uses true almost everywhere, but this bundle still had some uniqid() calls without this option.

@javiereguiluz javiereguiluz changed the title Use "more entropy" option when usin uniqid() function Use "more entropy" option when using uniqid() function Oct 3, 2016
@stof
Copy link
Member

stof commented Oct 3, 2016

I was not aware of the usage of usleep in this case.

@stof
Copy link
Member

stof commented Oct 3, 2016

Thank you @javiereguiluz.

@stof stof merged commit 2f52c4e into master Oct 3, 2016
stof added a commit that referenced this pull request Oct 3, 2016
…viereguiluz)

This PR was merged into the 2.x-dev branch.

Discussion
----------

Use "more entropy" option when using uniqid() function

As you can see in [the source code of the PHP uniqid() function](https://github.com/php/php-src/blob/1c295d4a9ac78fcc2f77d6695987598bb7abcb83/ext/standard/uniqid.c#L68) when you don't pass `true` as the second argument, PHP sleeps the application for 1 microsecond (`usleep(1)`)

Symfony uses `true` almost everywhere, but this bundle still had some uniqid() calls without this option.

Commits
-------

2f52c4e Use "more entropy" option when usin uniqid() function
@stof stof deleted the better_uniqid branch October 3, 2016 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants