Iteratively replaces the most frequently occurring byte pairs with unused byte values. Simple greedy approach that can achieve good compression on structured data with repeated patterns.
| Property | Value |
|---|---|
| Category | Compression Algorithms |
| Sub-category | Transform |
| Security status | Not classified |
| Complexity | Intermediate |
| Inventor | Philip Gage |
| Year | 1994 |
| Origin | πΊπΈ United States |
| Source | algorithms/compression/bpe.js |
Status: not classified β treat as unverified.
No vulnerabilities are recorded for this implementation.
3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Empty data test
| Field | Value |
|---|---|
input |
(empty) |
expected |
000000000000 |
Vector 2 β Single byte test
| Field | Value |
|---|---|
input |
41 |
expected |
0000010000004100 |
Vector 3 β Pattern with potential compression
| Field | Value |
|---|---|
input |
41424142 |
expected |
0000040000004100420041004200 |