Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add explanation of char skip for Code128C

  • Loading branch information...
commit 9ad696be4da66a5598be187aada14b1ec7574199 1 parent 01675ad
@toretore authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/barby/barcode/code_128.rb
View
2  lib/barby/barcode/code_128.rb
@@ -242,6 +242,8 @@ def characters
count = 0
while count < chars.size
if chars[count] =~ /^\d$/
+ #If encountering a digit, next char/byte *must* be second digit in pair. I.e. if chars[count] is 5,
+ #chars[count+1] must be /[0-9]/, otherwise it's not valid
result << "#{chars[count]}#{chars[count+1]}"
count += 2
else
Please sign in to comment.
Something went wrong with that request. Please try again.