Skip to content

Conversation

@saghul
Copy link
Member

@saghul saghul commented Aug 14, 2024

Sorry, got nerdsnipped and now you have you review this :-P

No need for a home-grown 8 16 char random string.
- Generate actually unique GUIDs
- Use a better random character generator
- Use a better alphabet for join codes which eliminates ambiguity
@@ -1,12 +1,87 @@
/**
* Helper class to generate random values one by one, using an auxiliary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat trick!

/**
* This alphabet removes all potential ambiguous symbols, so it's well suited for a code.
*/
const BASE32 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cuel. Something comes to mind though, users won't know that they can only enter non ambiguous chars, so on the remote side when they enter the code they still might confuse 0 with O, maybe remove O and I as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to stay with the base32 standard. A monospaced font should take care of that...

@saghul saghul merged commit 7f340e0 into master Aug 14, 2024
@saghul saghul deleted the better-random branch August 14, 2024 13:23
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.

3 participants