function calcBitMask(numBits) {
    var extraBits = numBits % 8;
    if (extraBits == 0) extraBits = 8;  // Get all the bits
    var mask = (Math.pow(2, extraBits) - 1);

    return mask;
}
// Calculate the bitmask - bits we are interested in - up to a full byte
Calculate the bitmask - bits we are interested in - up to a full byte
Calculate the bitmask - bits we are interested in - up to a full byte
function calcBitMask(numBits) {
    var extraBits = numBits % 8;
    if (extraBits == 0) extraBits = 8;  
    var mask = (Math.pow(2, extraBits) - 1);
    return mask;
}
function calcBitMask ( numBits ) { var extraBits = numBits % 8 ; if ( extraBits == 0 ) extraBits = 8 ; var mask = ( Math . pow ( 2 , extraBits ) - 1 ) ; return mask ; }
Calculate the bitmask - bits we are interested in - up to a full byte
Calculate the bitmask - bits we are interested in - up to a full byte
// Get all the bits