From 58ed45cf6570ac1fc702129d7724737936621b3e Mon Sep 17 00:00:00 2001 From: Billy Rond Date: Thu, 1 Feb 2018 21:14:37 -0700 Subject: [PATCH 1/3] fixed 'B' encoding for codabar --- codabar/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codabar/encoder.go b/codabar/encoder.go index 7e14c0e..0203d67 100644 --- a/codabar/encoder.go +++ b/codabar/encoder.go @@ -27,7 +27,7 @@ var encodingTable = map[rune][]bool{ '.': []bool{true, true, false, true, true, false, true, true, false, true}, '+': []bool{true, false, true, true, false, false, true, true, false, false, true, true}, 'A': []bool{true, false, true, true, false, false, true, false, false, true}, - 'B': []bool{true, false, true, false, false, true, false, false, true, true}, + 'B': []bool{true, false, false, true, false, false, true, false, true, true}, 'C': []bool{true, false, false, true, false, false, true, false, true, true}, 'D': []bool{true, false, true, false, false, true, true, false, false, true}, } From 79be24267e502de0c6d646ebb9f257b187a392cf Mon Sep 17 00:00:00 2001 From: Billy Rond Date: Fri, 2 Feb 2018 18:20:30 -0700 Subject: [PATCH 2/3] Swap 'B' and 'C' characters, fix '+' character --- codabar/encoder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codabar/encoder.go b/codabar/encoder.go index 0203d67..8e0f3f6 100644 --- a/codabar/encoder.go +++ b/codabar/encoder.go @@ -25,10 +25,10 @@ var encodingTable = map[rune][]bool{ ':': []bool{true, true, false, true, false, true, true, false, true, true}, '/': []bool{true, true, false, true, true, false, true, false, true, true}, '.': []bool{true, true, false, true, true, false, true, true, false, true}, - '+': []bool{true, false, true, true, false, false, true, true, false, false, true, true}, + '+': []bool{true, false, true, true, false, true, true, false, true, true}, 'A': []bool{true, false, true, true, false, false, true, false, false, true}, 'B': []bool{true, false, false, true, false, false, true, false, true, true}, - 'C': []bool{true, false, false, true, false, false, true, false, true, true}, + 'C': []bool{true, false, true, false, false, true, false, false, true, true}, 'D': []bool{true, false, true, false, false, true, true, false, false, true}, } From 33202215fe2182bb02afbe8220b4ed60f54f9833 Mon Sep 17 00:00:00 2001 From: Billy Rond Date: Fri, 2 Feb 2018 18:30:38 -0700 Subject: [PATCH 3/3] Update test case for updated 'B' codabar character --- codabar/encoder_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codabar/encoder_test.go b/codabar/encoder_test.go index 5f13009..24a1985 100644 --- a/codabar/encoder_test.go +++ b/codabar/encoder_test.go @@ -28,5 +28,5 @@ func Test_Encode(t *testing.T) { } } - testEncode("A40156B", "10110010010101101001010101001101010110010110101001010010101101010010011") + testEncode("A40156B", "10110010010101101001010101001101010110010110101001010010101101001001011") }