I've got some code in another language which uses an enum and a list of values from the enum and then uses bitwise to get an integer for the list of values from the enum.
HELLO = 1
WORLD = 2
AND = 4
SO = 8
ON = 16
So if I had HELLO and SO in my list I'd get a value back of
1 | 1000 = 1001
1001bin to dec = 9
I'm trying to work out what the most efficient way of taking this integer and giving back a list of the enums which were included.