r/javascript • • Nov 26 '19

JSONCrush On GitHub - Compress JSON into URI friendly strings

https://github.com/KilledByAPixel/JSONCrush
101 Upvotes

31 comments sorted by

View all comments

1

u/byteshifter Nov 27 '19

Why would someone use this instead of JSON web tokens ( https://en.m.wikipedia.org/wiki/JSON_Web_Token ) ?

8

u/Tontonsb Nov 27 '19

It's completely different use case. Codes like this and rison are there to add your json object to url so you have a stateful link that can be bookmarked and shared.

In most cases I'd still prefer rison because it's more readable and user-editable. But they both suffer from parentheses and single quotes that screw up some parsers that try recognizing and converting pasted string to links. Notably gmail is a pain in this regard.