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

fix username generator #36

Merged
merged 3 commits into from
Oct 10, 2020
Merged

fix username generator #36

merged 3 commits into from
Oct 10, 2020

Conversation

avil13
Copy link
Contributor

@avil13 avil13 commented Oct 7, 2020

Closes #34

@avil13
Copy link
Contributor Author

avil13 commented Oct 7, 2020

fix

@sdushantha
Copy link
Owner

I really like your take on this problem, but I think it would be better to use this instead:

84c84
<     USERNAME=$(head /dev/urandom | tr -dc "[:alnum:]" | cut -c1-11 | tr "[:upper:]" "[:lower:]")
---
>     USERNAME=$(head /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | cut -c1-11 | tr "[:upper:]" "[:lower:]")

By using LC_ALL=C, it fixes the issue with tr on macOS.
It also allows us to keep the randomness of the username, whereas in your fix it's not random because you are using date +%s

@sdushantha sdushantha merged commit 97d36f1 into sdushantha:master Oct 10, 2020
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.

name generation error
2 participants