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

Review case sensitivity inconsistencies #1389

Closed
jhogendorn opened this issue Feb 22, 2022 · 7 comments · Fixed by #1680
Closed

Review case sensitivity inconsistencies #1389

jhogendorn opened this issue Feb 22, 2022 · 7 comments · Fixed by #1680
Milestone

Comments

@jhogendorn
Copy link

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 vs HTTPS://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

image

Binary mode

image

You can play with a demo here:

https://jsfiddle.net/jhogendorn/kfLyu1hg/

@jhogendorn
Copy link
Author

Quick extra note, if you trust your readers, HTTPS:// can be swapped for WWW., gives 4 extra chars of namespace.

@acelaya
Copy link
Member

acelaya commented Feb 22, 2022

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?

@jhogendorn
Copy link
Author

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.

@acelaya
Copy link
Member

acelaya commented Feb 24, 2022

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.

@jhogendorn
Copy link
Author

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.

@acelaya acelaya changed the title Better QRCodes - Case Insensitive Mode - Base 36 Review case sensitivity inconsistencies Feb 26, 2022
@acelaya acelaya added this to Shlink Sep 25, 2022
@acelaya acelaya moved this to Todo 🗒️ in Shlink Sep 25, 2022
@acelaya acelaya removed the status in Shlink Sep 25, 2022
@acelaya
Copy link
Member

acelaya commented Dec 11, 2022

Related #706

@acelaya acelaya moved this to Todo 🗒️ in Shlink Jan 2, 2023
@acelaya acelaya added this to the 3.5.0 milestone Jan 2, 2023
@acelaya acelaya moved this from Todo 🗒️ to In Progress 📝 in Shlink Jan 25, 2023
@acelaya acelaya moved this from In Progress 📝 to In review 👀 in Shlink Jan 28, 2023
@acelaya
Copy link
Member

acelaya commented Jan 28, 2023

I have just finished implementing case-insensitive support for short URLs: See #706 (comment)

@github-project-automation github-project-automation bot moved this from In review 👀 to Done ✅ in Shlink Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants