Lichen

tests/bitwise.py

908:8b0c4d9b2c99
2019-06-08 Paul Boddie Merged changes from the default branch. trailing-data
     1 def encode(value):     2     return ((value & 8) << 4) | ((value & 4) << 3) | ((value & 2) << 2) | ((value & 1) << 1)     3      4 print encode(15)    # 170     5 print encode(8)     # 128     6 print encode(2)     # 8     7 print encode(0)     # 0