barcode
barcode copied to clipboard
Externalize Pattern Generation
Take all pattern generation code and place it into a function to generate it.
Should have this prototype:
/*
* @param String|Array sequence - Sequence of compatible characters for encoding
* @param String|Int checkdigit - calculated check digit
* @return Array<Int> - Array of bar/space widths (alternating, starting with bar)
*/
function generateSequence(sequence, checkdigit) { }