Simple JavaScript implementation of a UPC-A string validator and legacy UPC conversion (10-digit to 12-digit). 12-digit input will be validated. 10-digit input will prepend a leading zero and append a calculated UPC check digit.