5 ms·
Can't you just base64 url safe encode it and get the same result? Aren't URl strings limited in their length as well?
by zer0faith 7y ago
Can't you just base64 url safe encode it and get the same result? Aren't URl strings limited in their length as well?
- emj 7y agoIf you don't care about IE and Edge you can fit 8KB-64KB in the URI, otherwise 2K is pretty safe.
- KilledByAPixel 7y agoAs far as I know base64 is not guaranteed to be uri safe, though most of the time you should be fine. However more importantly converting to base64 automatically increases the size by 33% https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding https://developer.mozilla.org/en-US/docs/Web/API/WindowBase6...
- CodesInChaos 7y agoThe parent poster was referring to the "base64url" variant of Base64 which uses `-` and `_` as the two special characters and leaves out the useless padding, making it url safe. (The 33% expansion still applies though) https://tools.ietf.org/html/rfc4648#page-7 https://tools.ietf.org/html/rfc4648#page-7
- anderspitman 7y agoAs others mentioned, size is the main concern here, which is also why JSONCrush could be useful. But I'd definitely use POSTs first if possible.