How the JSCrush algorithm works
masterThe JSCrush algorithm is optimized for URI-encoded JSON strings. It achieves compression through several mechanisms:
- Substring Elimination: Similar to the zip algorithm, it eliminates repeated substrings.
- Character Swapping: It processes strings to swap common JSON characters with characters that do not require escaping in a URL.
- Delimiter Usage: It uses the
\u0001(start of heading) character as a delimiter, which is removed during processing.
Performance Considerations:
- The algorithm is highly efficient for most use cases.
- It may become slow when processing very long strings (exceeding 10,000 characters).