illinois / clickin

Open Source Polling App
University of Illinois/NCSA Open Source License
14 stars 44 forks source link

Random Short URL Generator #30

Closed sathreddy closed 4 years ago

sathreddy commented 5 years ago

We will need to generate a short url to quick-join a polling session. For example, click.in/xYz6. The code that's generated should be easy to read/type (no special characters). Think of edge cases of specific words we want to avoid (censor out swear word possibilities).

brianstrauch commented 5 years ago

Codes should be encoded in Base62. Think Base64, but without '+' or '/'.

brianstrauch commented 5 years ago

We want to keep codes as short as possible to keep our users happy.

Some quick math: 2 characters = 62^2 = 4K sessions 3 characters = 62^3 = 230K sessions 4 characters = 62^4 = 15M sessions

Although we will likely never have to support 230 thousand sessions, I vote for 3 digit codes so codes are easy to type and the probability of manually guessing someone else's session is well under 1%.

m-pitera commented 4 years ago

I'll be implementing the 3 character, I also think that'd be the best.

m-pitera commented 4 years ago

Opened a PR #41

tdog191 commented 4 years ago

I see no downside to using 4-character codes. Compared to 3-character codes, they would be harder to guess, scale better if multiple courses across universities around the world use clickin, and still be short and easy to type. That is just my opinion.

m-pitera commented 4 years ago

The way I implemented the method allows for whatever is calling the method to specify the amount of elements they want in the code. So it'll be very flexible to change based off out future design decisions 👍