Hufint
Purpose
A Hufint is a variable-length-coded integer.
The contract of this coding tool is:
- allow to encode any positive integer (including 0) a a se of bit
- allow a non-ambiguous decoding algorithm
- use less bits for smaller integer
Hufint are used in the matscape projects, wherever
- integer values are likely to be small (example: number of child)
- integer values are allowed to be very large (but seldom)
- encoding size is critical
- speed for math operations on the values is not critical
Hufint base
The Hufint base is the slice size for the hufint bitset representation.
Matscape uses Hufint-6 representations, and
- number from 0 to 31 are represented on 6 bits