A Solidity library that compresses uint256 values into smaller types for tighter struct packing and lower gas costs.
Compress values that don't need full uint256 resolution so more fields fit per storage slot, cutting SSTORE/SLOAD costs.
create(shift, targetBits)Create a quantization schemeencode(value)Floor-encode a value (reverts on overflow)encode(value, true)Strict encode (reverts if value is not step-aligned)decode(encoded)Restore lower-bound valuedecodeMax(encoded)Restore upper-bound valuefits(value)Check if value is representablefloor(value) / ceil(value)Snap to nearest step boundarystepSize() / max()Query scheme parameters