BBOR62 is a versatile binary encoder designed for efficiency and simplicity. With no dependencies, it offers a pure alphanumeric compression solution that is schema-less and bidirectional, supporting UTF-16. Ideal for encoding JSON payloads, it streamlines data handling while ensuring portability and URL safety.
bbor62 is a highly efficient binary encoder that excels in converting binary data into alphanumeric text format. This project was born out of the need for a general-purpose binary encoder that preserves a multitude of essential features, including:
The project initially commenced as an exploration of Pieroxy's lz-string compressor. While effective, lz-string did not meet specific requirements for JSON payload compression, which inspired the development of bbor62. The encoder integrates concepts from CBOR, LZW, and Base62 to create a more efficient and portable solution that is also URL-safe.
A summary of compression performance is illustrated below, using a sample JSON data set. Each encoder is evaluated on its compression ratio and the number of characters produced:
| Encoder | Compressed Characters | Compression Ratio |
|---|---|---|
| base64 | 2152 | 133.33% |
| base62 | 2169 | 134.38% |
| lz-string utf-16 | 411 | 25.46% |
| lz-string uri | 1096 | 67.90% |
| cbor base64 | 1076 | 66.66% |
| cbor base62 | 1082 | 67.03% |
| bbor62 string | 1071 | 66.35% |
| bbor62 object | 769 | 47.64% |
The following JSON sample provides an illustration of the data encoded by bbor62:
{
"organization": {
"name": "Tech Innovators Inc.",
"founded": 2010,
"headquarters": {
"street": "123 Innovation Way",
"city": "San Francisco",
"state": "CA",
"zipCode": "94105"
},
"employees": [
{
"id": "E001",
"firstName": "John",
"lastName": "Smith",
"role": "Software Engineer",
"department": "Engineering",
"skills": ["JavaScript", "Python", "AWS"],
"contactInfo": {
"email": "john.smith@techinnovators.com",
"phone": "+1-555-123-4567",
"extension": 101
},
"projects": [
{
"name": "Cloud Migration",
"status": "in-progress",
"deadline": "2024-12-31"
},
{
"name": "Mobile App Development",
"status": "completed",
"deadline": "2024-06-30"
}
]
},
{
"id": "E002",
"firstName": "Jane",
"lastName": "Doe",
"role": "Product Manager",
"department": "Product",
"skills": ["Agile", "Strategy", "User Research"],
"contactInfo": {
"email": "jane.doe@techinnovators.com",
"phone": "+1-555-123-4568",
"extension": 102
},
"projects": [
{
"name": "Market Analysis",
"status": "pending",
"deadline": "2024-09-30"
}
]
}
],
"activeSites": true,
"revenue": {
"2022": 5000000,
"2023": 7500000,
"projected2024": 9223372036854775807
}
}
}
bbor62 represents a significant advancement in the field of binary data compression. With its combination of efficiency, ease of use, and robust performance, it is an ideal solution for developers seeking a reliable way to compress and encode binary data.
No comments yet.
Sign in to be the first to comment.