I\'m parsing a binary file in javascript that is storing two pieces of information per byte, one per nibble. The values are, of course, 0-16 and 0-16.
In all other parts
var num = str.charCodeAt(0) & 0xFF; var nibble1 = num & 0xF; var nibble2 = num >> 4;