code: function autoSelectFromAB(string, isA) {
  	var ranges = isA ? A_CHARS : B_CHARS;
  	var untilC = string.match(new RegExp('^(' + ranges + '+?)(([0-9]{2}){2,})([^0-9]|$)'));
  
  	if (untilC) {
  		return untilC[1] + String.fromCharCode(204) + autoSelectFromC(string.substring(untilC[1].length));
  	}
  
  	var chars = string.match(new RegExp('^' + ranges + '+'))[0];
  
  	if (chars.length === string.length) {
  		return string;
  	}
  
  	return chars + String.fromCharCode(isA ? 205 : 206) + autoSelectFromAB(string.substring(chars.length), !isA);
  }
docs: CODE128A or CODE128B