Debian Codegraph @

byte_encoder.go

raw symbols SCIP
1 package pdf417
2
3 // Code word used to switch to Text mode.
4 const BYTE_SWITCH_CODE_WORD = 901
5
6 // Alternate code word used to switch to Text mode; used when number of
7 // Texts to encode is divisible by 6.
8 const BYTE_SWITCH_CODE_WORD_ALT = 924
9
10 type ByteEncoder struct {
11
12 }
13
14 func CreateByteEncoder() *ByteEncoder {
15 return new(ByteEncoder)
16 }
17
18 func (ByteEncoder) CanEncode(char string) bool {
19 return true
20 }
21
22 func (ByteEncoder) GetSwitchCode(data string) int {
23 if (len(data) % 6 == 0) {
24 return BYTE_SWITCH_CODE_WORD_ALT
25 }
26
27 return BYTE_SWITCH_CODE_WORD
28 }