I found a clever bit of code in the site I'm working on that uses hex values to store an array of toggleable variables.
(For example, D in hex being 1101 in binary, means the first toggle is one, the second is off, and the third and fourth are on).
I looked at unpack, but either I didn't understand it or it's not the right function for me. I also considered splitting the whole thing character by character and then sending each character through a switch that then drops values into an array, but that seems way too cumbersome and inelegant.
So, how do I turn a string of hex-based characters into an ordered array of Boolean values?
"D"into an array, like:Array ( True, True, False, True )?1? Should the resulting array be[True]or[False, False, False, True]or something else?