How to use bitmask?

Bit masking is “useful” to use when you want to store (and subsequently extract) different data within a single data value. An example application I’ve used before is imagine you were storing colour RGB values in a 16 bit value. So something that looks like this: You could then use bit masking to retrieve the … Read more

What is a bitmask and a mask?

On the PHP documentation about JSON it mentions the word bitmask. Wikipedia has it defined as a mask. I don’t understand either bitmask or mask or how they are useful. Can some one explain these terms using layman’s terms and no jargon?