LoRa, sending only the minimum required data size

In the LoRa example found here how could I send only the minimum required bits for an int number? For example I want to send number between 0 and 14 so I need for bits. But it would also be interesting for larger numbers.

Hi, I’m not familiar with that example. Arduino might have more info.