Mads Kristensen got one down to 00amyWGct0y_ze4lIsj2Mw
Can it go smaller than that?
URL Encoding (Percent Encoding) URLs can only be sent over the Internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
A space is assigned number 32, which is 20 in hexadecimal. When you see “%20,” it represents a space in an encoded URL, for example, http://www.example.com/products%20and%20services.html.
So a 16 byte guid will just fit into 20 Ascii characters using this encoding scheme. A Guid can have 3.1962657931507848761677563491821e+38 discrete values whereas 20 characters of Ascii-85 can have 3.8759531084514355873123178482056e+38 discrete values.
URL encoding is also called percent encoding since it uses percent sign ( %) as an escape character. Space: One of the most frequent URL Encoded character you’re likely to encounter is space. The ASCII value of space character in decimal is 32, which when converted to hex comes out to be 20.
The following table is a reference of ASCII characters to their corresponding URL Encoded form. Note that, Encoding alphanumeric ASCII characters are not required. For example, you don’t need to encode the character '0' to %30 as shown in the following table. It can be transmitted as is.
There are only certain characters that are allowed in the URL string, alphabetic characters, numerals, and a few characters ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) # that can have special meanings. Any character that is not an alphabetic character, a number, or a reserved character being used needs to be encoded.
It can be transmitted as is. But the encoding is still valid as per the RFC. All the characters that are safe to be transmitted inside URLs are colored green in the table. The following table uses rules defined in RFC 3986 for URL encoding.
Looks like there are only 73 characters that can be used unescaped in a URL. IF that's the case, you could convert the 128-bit number to base 73, and have a 21 character URL.
IF you can find 85 legal characters, you can get down to a 20 character URL.
A GUID looks like this c9a646d3-9c61-4cb7-bfcd-ee2522c8f633 - that's 32 hex digits, each encoding 4 bits, so 128 bits in total
A base64 encoding uses 6 bits per symbol, which is easy to achieve with URL safe chars to give a 22 char encoded string. As others have noted, you could with with 73 url safe symbols and encoded as a base 73 number to give 21 chars.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With