code: function readBitField(bits, bitIndex) {
  	var bitLen = 8 * (bits.length - 1) - bits[0];
  	var setBits = {};
  	for (var i = 0; i < bitLen; ++i) {
  		var byteN = 1 + Math.floor(i / 8);
  		var bit = 7 - (i % 8);
  		var mask = 1 << bit;
  		var bitVal = ((bits[byteN] & mask) !== 0);
  		var name = bitIndex[i];
  		if (bitVal && typeof (name) === 'string') {
  			setBits[name] = true;
  		}
  	}
  	return (Object.keys(setBits));
  }
docs: /*
  Reads an ASN.1 BER bitfield out of the Buffer produced by doing
  `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw
  contents of the BitString tag, which is a count of unused bits followed by
  the bits as a right-padded byte string.
  
  `bits` is the Buffer, `bitIndex` should contain an array of string names
  for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.
  
  Returns an array of Strings, the names of the bits that were set to 1.