Hawkynt

Elias Gamma Coding

Peter Elias universal integer encoding optimal for geometric distributions where small values are more frequent.

Properties

Property Value
Category Compression Algorithms
Sub-category Universal
Security status πŸŽ“ Educational Only
Complexity Intermediate
Inventor Peter Elias
Year 1975
Origin πŸ‡ΊπŸ‡Έ United States
Source algorithms/compression/elias-gamma.js

Security

Status: πŸŽ“ Educational Only

No vulnerabilities are recorded for this implementation.

Documentation

References

Test vectors

2 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.

Vector 1 β€” Small integer sequence

Field Value
input 0102030405
expected 050000004c8530

Vector 2 β€” Mixed small and large values

Source: Boundary value test

Field Value
input 7f8081ff
expected 040000000100020404100400

← All algorithms