constants.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Standard start end and middle bits
  2. export const SIDE_BIN = '101';
  3. export const MIDDLE_BIN = '01010';
  4. export const BINARIES = {
  5. 'L': [ // The L (left) type of encoding
  6. '0001101', '0011001', '0010011', '0111101', '0100011',
  7. '0110001', '0101111', '0111011', '0110111', '0001011'
  8. ],
  9. 'G': [ // The G type of encoding
  10. '0100111', '0110011', '0011011', '0100001', '0011101',
  11. '0111001', '0000101', '0010001', '0001001', '0010111'
  12. ],
  13. 'R': [ // The R (right) type of encoding
  14. '1110010', '1100110', '1101100', '1000010', '1011100',
  15. '1001110', '1010000', '1000100', '1001000', '1110100'
  16. ],
  17. 'O': [ // The O (odd) encoding for UPC-E
  18. '0001101', '0011001', '0010011', '0111101', '0100011',
  19. '0110001', '0101111', '0111011', '0110111', '0001011'
  20. ],
  21. 'E': [ // The E (even) encoding for UPC-E
  22. '0100111', '0110011', '0011011', '0100001', '0011101',
  23. '0111001', '0000101', '0010001', '0001001', '0010111'
  24. ]
  25. };
  26. // Define the EAN-2 structure
  27. export const EAN2_STRUCTURE = ['LL', 'LG', 'GL', 'GG'];
  28. // Define the EAN-5 structure
  29. export const EAN5_STRUCTURE = [
  30. 'GGLLL', 'GLGLL', 'GLLGL', 'GLLLG', 'LGGLL',
  31. 'LLGGL', 'LLLGG', 'LGLGL', 'LGLLG', 'LLGLG'
  32. ];
  33. // Define the EAN-13 structure
  34. export const EAN13_STRUCTURE = [
  35. 'LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG',
  36. 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL'
  37. ];