MCPcopy
hub / github.com/skip2/go-qrcode / modeIndicator

Method modeIndicator

encoder.go:373–386  ·  view source on GitHub ↗

modeIndicator returns the segment header bits for a segment of type dataMode.

(dataMode dataMode)

Source from the content-addressed store, hash-verified

371
372// modeIndicator returns the segment header bits for a segment of type dataMode.
373func (d *dataEncoder) modeIndicator(dataMode dataMode) *bitset.Bitset {
374 switch dataMode {
375 case dataModeNumeric:
376 return d.numericModeIndicator
377 case dataModeAlphanumeric:
378 return d.alphanumericModeIndicator
379 case dataModeByte:
380 return d.byteModeIndicator
381 default:
382 log.Panic("Unknown data mode")
383 }
384
385 return nil
386}
387
388// charCountBits returns the number of bits used to encode the length of a data
389// segment of type dataMode.

Callers 2

encodeDataRawMethod · 0.95
encodedLengthMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected