Skip to content

Instantly share code, notes, and snippets.

@vistun
vistun / UPCcheckDigit.js
Created Sep 3, 2016
Generate check digit for UPC-A
View UPCcheckDigit.js
function checkDigit(bc) {
while (bc.length < 11) {
bc = "0"+bc;
}
if (bc.length > 11) {
return bc;
}
var osum = 0;