Created
March 23, 2018 15:55
-
-
Save albertodeste/ed371463a00d4a90066f48f46a80af74 to your computer and use it in GitHub Desktop.
Javascript barcode generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){for(var eanCode="",i=0;12>i;i++)eanCode+=Math.floor(10*Math.random());var checkDigit=0,rs=eanCode.split("");for(rs=rs.reverse(),rs=rs.join(""),counter=0;counter<rs.length;counter++)checkDigit+=parseInt(rs.charAt(counter))*Math.pow(3,(counter+1)%2);checkDigit=(10-checkDigit% 10)% 10,prompt("EAN13",eanCode+checkDigit);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment