I have four integers {a, b, c, d} that can have the following range of values:
a
b
c
d
a - {0 or 1} (1 bi
def encode(a, b, c, d): return a | b << 1 | c << 2 | d << 5 def decode(x): return x & 1, (x >> 1) & 1, (x >> 2) & 7, (x >> 5) & 7