Completed
Push — master ( bdd11a...04b37b )
by
unknown
10s
created

src/barcodes/EAN_UPC/constants.js   A

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 40
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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