Difficult to say not knowing what it is inteded for.
I.e. the assumption you made that the machine which read the code can consider nibbles means that 12bits is not the word size of that machine. The meaning of endianess on unknown siize machine is a big issue (it can have 6bits word in this case you have to save the first 6 bits than the next for little endian).
If the machine, or the code that use the data, is byte oriented maybe your first guess is the correct one...
If I well remember, from times where I wrote assembly to access floppies 12bits FAT, the trick was to read 3 bytes at time then mask the value to get the first 12 bits, than shift right by 12 to get the next 12 bits.