updated docs and code cleanup
This commit is contained in:
1 parent
bccb3d2ede
commit
d0cdae0475
10 files changed
+137
-106
No files matched your search
+5
-2
@@ -1,11 +1,13 @@
|
||||
// Package code128 can create Code128 barcodes
|
||||
package code128
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/boombuler/barcode"
|
||||
"github.com/boombuler/barcode/utils"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/boombuler/barcode"
|
||||
"github.com/boombuler/barcode/utils"
|
||||
)
|
||||
|
||||
func strToRunes(str string) []rune {
|
||||
@@ -65,6 +67,7 @@ func getCodeIndexList(content []rune) *utils.BitList {
|
||||
return result
|
||||
}
|
||||
|
||||
// Encode creates a Code 128 barcode for the given content
|
||||
func Encode(content string) (barcode.Barcode, error) {
|
||||
contentRunes := strToRunes(content)
|
||||
if len(contentRunes) < 0 || len(contentRunes) > 80 {
|
||||
|
||||
Reference in new issue
Block a user