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

util: random_string is now more entropic #29312

Merged
merged 3 commits into from Aug 11, 2023
Merged

util: random_string is now more entropic #29312

merged 3 commits into from Aug 11, 2023

Conversation

ghost
Copy link

@ghost ghost commented Aug 10, 2023

sizeof(char*) is going to be 8 on a 64-bit system, not the length of the string. Before, only strings of integer values [0-6] were being generated. Also switched to C++ constructs for simplicity.

sizeof(char*) is going to be 8 on a 64-bit system, not the length of the
string. Before, only strings of integer values [0-6] were being generated. Also
switched to C++ constructs for simplicity.
common/util.cc Outdated Show resolved Hide resolved
@sshane sshane added the bugfix label Aug 10, 2023
common/util.cc Outdated Show resolved Hide resolved
@sshane sshane changed the title random_string now returns a significantly higher entropy random string util: random_string is now more entropic Aug 11, 2023
@sshane sshane merged commit 4cad0a0 into commaai:master Aug 11, 2023
18 checks passed
Edison-CBS pushed a commit to Edison-CBS/openpilot that referenced this pull request Aug 11, 2023
* random_string now returns a significantly higher entropy random string

sizeof(char*) is going to be 8 on a 64-bit system, not the length of the
string. Before, only strings of integer values [0-6] were being generated. Also
switched to C++ constructs for simplicity.

* Update common/util.cc

* maintain repo style

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant