func (e *encoder) encodeAlphanumeric() {
	if e.dst == nil {
		log.Println("e.dst is nil")
		return
	}
	for i := 0; i < len(e.data); i += 2 {
		charsRemaining := len(e.data) - i
		var value uint32
		for j := 0; j < charsRemaining && j < 2; j++ {
			value *= 45
			value += encodeAlphanumericCharacter(e.data[i+j])
		}
		bitsUsed := 6
		if charsRemaining > 1 {
			bitsUsed = 11
		}
		e.dst.AppendUint32(value, bitsUsed)
	}
}
0010b mode indicator
package qrcode
import (
	"fmt"
	"log"
	"github.com/yeqown/reedsolomon/binary"
)
type encMode uint
const (
	EncModeAuto = 0
	EncModeNone encMode = 1 << iota
	EncModeNumeric
	EncModeAlphanumeric
	EncModeByte
	EncModeJP
)
var (
	paddingByte1, _ = binary.NewFromBinaryString("11101100")
	paddingByte2, _ = binary.NewFromBinaryString("00010001")
)
func getEncModeName(mode encMode) string {
	switch mode {
	case EncModeNone:
		return "none"
	case EncModeNumeric:
		return "numeric"
	case EncModeAlphanumeric:
		return "alphanumeric"
	case EncModeByte:
		return "byte"
	case EncModeJP:
		return "japan"
	default:
		return "unknown"
	}
}
func getEncodeModeIndicator(mode encMode) *binary.Binary {
	switch mode {
	case EncModeNumeric:
		return binary.New(false, false, false, true)
	case EncModeAlphanumeric:
		return binary.New(false, false, true, false)
	case EncModeByte:
		return binary.New(false, true, false, false)
	case EncModeJP:
		return binary.New(true, false, false, false)
	default:
		panic("no indicator")
	}
}
type encoder struct {
	dst  *binary.Binary
	data []byte  
	mode encMode  
	ecLv ecLevel  
	version version  
}
func (e *encoder) Encode(byts []byte) (*binary.Binary, error) {
	e.dst = binary.New()
	e.data = byts
	indicator := getEncodeModeIndicator(e.mode)
	e.dst.Append(indicator)
	e.dst.AppendUint32(uint32(len(byts)), e.charCountBits())
	switch e.mode {
	case EncModeNumeric:
		e.encodeNumeric()
	case EncModeAlphanumeric:
		e.encodeAlphanumeric()
	case EncModeByte:
		e.encodeByte()
	case EncModeJP:
		panic("this has not been finished")
	}
	e.breakUpInto8bit()
	return e.dst, nil
}
func (e *encoder) encodeNumeric() {
	if e.dst == nil {
		log.Println("e.dst is nil")
		return
	}
	for i := 0; i < len(e.data); i += 3 {
		charsRemaining := len(e.data) - i
		var value uint32
		bitsUsed := 1
		for j := 0; j < charsRemaining && j < 3; j++ {
			value *= 10
			value += uint32(e.data[i+j] - 0x30)
			bitsUsed += 3
		}
		e.dst.AppendUint32(value, bitsUsed)
	}
}