Compare commits
2 Commits
ca3e24f327
...
914f64a08d
Author | SHA1 | Date | |
---|---|---|---|
|
914f64a08d | ||
|
c575a3c357 |
@ -27,8 +27,8 @@ import (
|
|||||||
"image/png"
|
"image/png"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/qr"
|
"git.bbr-dev.info/brajkovic/barcode/qr"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -48,6 +48,6 @@ func main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Documentation ##
|
## Documentation ##
|
||||||
See [GoDoc](https://godoc.org/github.com/boombuler/barcode)
|
See [GoDoc](https://godoc.org/git.bbr-dev.info/brajkovic/barcode)
|
||||||
|
|
||||||
To create a barcode use the Encode function from one of the subpackages.
|
To create a barcode use the Encode function from one of the subpackages.
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type aztecCode struct {
|
type aztecCode struct {
|
||||||
|
@ -4,8 +4,8 @@ package aztec
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_StuffBits(t *testing.T) {
|
func Test_StuffBits(t *testing.T) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package aztec
|
package aztec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func bitsToWords(stuffedBits *utils.BitList, wordSize int, wordCount int) []int {
|
func bitsToWords(stuffedBits *utils.BitList, wordSize int, wordCount int) []int {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package aztec
|
package aztec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func highlevelEncode(data []byte) *utils.BitList {
|
func highlevelEncode(data []byte) *utils.BitList {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func bitStr(bl *utils.BitList) string {
|
func bitStr(bl *utils.BitList) string {
|
||||||
|
@ -3,7 +3,7 @@ package aztec
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodingMode byte
|
type encodingMode byte
|
||||||
|
@ -3,7 +3,7 @@ package aztec
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type token interface {
|
type token interface {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var encodingTable = map[rune][]bool{
|
var encodingTable = map[rune][]bool{
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func strToRunes(str string) []rune {
|
func strToRunes(str string) []rune {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodeInfo struct {
|
type encodeInfo struct {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodeInfo struct {
|
type encodeInfo struct {
|
||||||
|
@ -3,8 +3,8 @@ package datamatrix
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type setValFunc func(byte)
|
type setValFunc func(byte)
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type datamatrixCode struct {
|
type datamatrixCode struct {
|
||||||
|
@ -4,7 +4,7 @@ package datamatrix
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Encode returns a Datamatrix barcode for the given content and color scheme
|
// Encode returns a Datamatrix barcode for the given content and color scheme
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package datamatrix
|
package datamatrix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type errorCorrection struct {
|
type errorCorrection struct {
|
||||||
|
@ -4,8 +4,8 @@ package ean
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodedNumber struct {
|
type encodedNumber struct {
|
||||||
|
2
go.mod
2
go.mod
@ -1 +1 @@
|
|||||||
module github.com/boombuler/barcode
|
module git.bbr-dev.info/brajkovic/barcode
|
||||||
|
@ -3,8 +3,8 @@ package pdf417
|
|||||||
import "math"
|
import "math"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
minCols = 2
|
minCols = 9
|
||||||
maxCols = 30
|
maxCols = 9
|
||||||
maxRows = 30
|
maxRows = 30
|
||||||
minRows = 2
|
minRows = 2
|
||||||
moduleHeight = 2
|
moduleHeight = 2
|
||||||
|
@ -4,8 +4,8 @@ package pdf417
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodingMode byte
|
type encodingMode byte
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pdfBarcode struct {
|
type pdfBarcode struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const charSet string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"
|
const charSet string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"
|
||||||
|
@ -3,7 +3,7 @@ package qr
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func encodeAuto(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
func encodeAuto(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
||||||
|
@ -4,8 +4,8 @@ package qr
|
|||||||
import (
|
import (
|
||||||
"image"
|
"image"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type encodeFn func(content string, eccLevel ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error)
|
type encodeFn func(content string, eccLevel ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error)
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
)
|
)
|
||||||
|
|
||||||
type test struct {
|
type test struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package qr
|
package qr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type errorCorrection struct {
|
type errorCorrection struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func encodeNumeric(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
func encodeNumeric(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"image/color"
|
"image/color"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type qrcode struct {
|
type qrcode struct {
|
||||||
|
@ -3,7 +3,7 @@ package qr
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func encodeUnicode(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
func encodeUnicode(content string, ecl ErrorCorrectionLevel) (*utils.BitList, *versionInfo, error) {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
"github.com/boombuler/barcode/utils"
|
"git.bbr-dev.info/brajkovic/barcode/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const patternWidth = 5
|
const patternWidth = 5
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"github.com/boombuler/barcode"
|
"git.bbr-dev.info/brajkovic/barcode"
|
||||||
)
|
)
|
||||||
|
|
||||||
type base1DCode struct {
|
type base1DCode struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user