code: function bi_reverse(code, len) {
  		var res = 0;
  		do {
  			res |= code & 1;
  			code >>= 1;
  			res <<= 1;
  		} while (--len > 0);
  		return res >> 1;
  	}
docs: /* ==========================================================================
  Reverse the first len bits of a code, using straightforward code (a faster
  method would use a table)
  IN assertion: 1 <= len <= 15
  
  @param code- the value to invert
  @param len- its bit length