Universal code for positive integers with self-delimiting property. Efficient encoding scheme for integers with unknown probability distribution, using recursive length encoding.
| Property | Value |
|---|---|
| Category | Compression Algorithms |
| Sub-category | Universal Codes |
| Security status | π Educational Only |
| Complexity | Intermediate |
| Inventor | Peter Elias |
| Year | 1975 |
| Origin | πΊπΈ United States |
| Source | algorithms/compression/omega.js |
Status: π Educational Only
No vulnerabilities are recorded for this implementation.
7 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Empty input
| Field | Value |
|---|---|
input |
(empty) |
expected |
00000000 |
Vector 2 β Single byte value
| Field | Value |
|---|---|
input |
41 |
expected |
01000000b420 |
Vector 3 β Repeated byte values
| Field | Value |
|---|---|
input |
4141 |
expected |
02000000b425a100 |
Vector 4 β Two different byte values
| Field | Value |
|---|---|
input |
4142 |
expected |
02000000b425a180 |
Vector 5 β Three different byte values
| Field | Value |
|---|---|
input |
414243 |
expected |
03000000b425a1ad10 |
Vector 6 β Hello string bytes
| Field | Value |
|---|---|
input |
48656c6c6f |
expected |
05000000b495b32db56dab7000 |
Vector 7 β Sequential small values
| Field | Value |
|---|---|
input |
0102030405 |
expected |
050000009a8aac |