-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Review case sensitivity inconsistencies #1389
Comments
Quick extra note, if you trust your readers, |
This is super interesting, but I'm not completely sure what's your point here 😅 I guess you are trying to request a feature somehow? |
The feature would be shlink being case sensitive or insensitive. As far as i can tell at the moment, it forces all urls to lowercase and then does case sensitive checks. So i cant put in my slug as MYSLUG, because shlink turns it into myslug and wont match https://my.url/MYSLUG. It's kind of in this no mans land where its both case sensitive and case insensitive. |
Ooohhh. Ok, now I get it. Yeah, there's some inconsistency there. I need to give it a thought. I got confused by all the information regarding QR codes specifically, but I guess that's more of a side effect, or if anything, extra improvement for once the uppercase/lowercase inconsistency has been tackled. |
Apologies, the QR Code stuff is more like 'why this is worth getting right'. Because otherwise it seems like a pointless improvement for no gain. |
Related #706 |
I have just finished implementing case-insensitive support for short URLs: See #706 (comment) |
Summary
If shlink can be put into a case insensitive mode (global or per url?) and the automatic generation uses base36 (A-Z0-9) then qrcodes can be generated in L error correction in alphanumeric mode, and will allow 25 characters in the url before the qrcode will generate an alignment marking.
If you have https:// and a 5 char short url + 1 for the period + 1 for forward slash, thats 10 chars for the identifier, or 3656158440062975 combinations (ZZZZZZZZZZ). ie
https://my.url/shlink1234
vsHTTPS://MY.URL/SHLINK1234
. If you're doing http to https redirection you can eke out another char if needed. You can't really drop the the protocol prefix as not all readers assume a url.You could get more if you allow symbols that are allowed in the alphanumeric set
0–9, A–Z (upper-case only), space, $, %, *, +, -, ., /, :
but its not really needed and makes urlencoding issues.Doing this lets you create the simplest possible qrcode, which makes them as readable as possible on the worst cameras. They are slightly less resilient to damage but intact codes read fast in the worst conditions.
(I used to have a startup around this stuff, trying to get <2mp terrible cheap android tablet front cameras to read small qrcodes at distance fast).
Compare:
Alphanumeric mode
Binary mode
You can play with a demo here:
https://jsfiddle.net/jhogendorn/kfLyu1hg/
The text was updated successfully, but these errors were encountered: