Regular URL Simplification uses a few characters of a regular URL encoding because you don’t need more. A typical short URL http://domain/code, where the code is an integer. Suppose I can use any base (base10, base16, base36 , base62, etc.) to represent a number.
QR code has many encodings , and we can optimize the QR code (the minimum version to get the lowest density ), so we can test baseX-modeY pairs ...
What is the best base mode pair?
NOTES
A guess...
Two modes correspond to the "URL profile abbreviation",
- 0010 - Alphanumeric Encoding (11 bits to 2 )
- 0100- Byte Encoding (8 bits per character)
My choice was “base36 uppercase” and alphanumeric (which also encodes “/”, “:”, etc.), but does not see any demonstration that it is always (for any URL length) the best. Got some good recommendations or math demos about this optimization?
Ideal (possibly impracticable)
There is another variation: “coding modes can be mixed as needed in a QR symbol” (Wikipedia) ... So, we can use also
HTTP://DOMAIN/with alphanumeric + change_mode + digital coding (10 bits by 3 )
URL- ( ), , (!), , ... ?
, ( ) QRCode-... ? ?
() - , (, Javascript),
function bestBaseMode(domain,number_range) {
var dom_len = domain.length;
var urlBase_len = dom_len+8;
var num_min = number_range[0];
var num_max = number_range[1];
return [base,mode];
}
-1: " .ly" ISO3166-1- ,
4 894. , urlBase_len=14, num_min=4 num_max=894.
-2: "postcode-resolver.org", number_range - , , ~ 999 ~ 999999. , urlBase_len=27, num_min=999 num_max=9999999.
-3: "my-example3.net" number_range - SHA-1, 40 (2 40- ). num_max=num_min=Math.pow(8,40).