Barcode Generation

This commit is contained in:
CAnetzberger
2022-02-21 15:01:43 +01:00
parent aa6c93f3f6
commit 79ec11e25c
224 changed files with 22474 additions and 95 deletions

20
node_modules/jsbarcode/src/barcodes/EAN_UPC/encoder.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { BINARIES } from './constants';
// Encode data string
const encode = (data, structure, separator) => {
let encoded = data
.split('')
.map((val, idx) => BINARIES[structure[idx]])
.map((val, idx) => val ? val[data[idx]] : '');
if (separator) {
const last = data.length - 1;
encoded = encoded.map((val, idx) => (
idx < last ? val + separator : val
));
}
return encoded.join('');
};
export default encode;