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

Method charCountBits

encoder.go:390–403  ·  view source on GitHub ↗

charCountBits returns the number of bits used to encode the length of a data segment of type dataMode.

(dataMode dataMode)

Source from the content-addressed store, hash-verified

388// charCountBits returns the number of bits used to encode the length of a data
389// segment of type dataMode.
390func (d *dataEncoder) charCountBits(dataMode dataMode) int {
391 switch dataMode {
392 case dataModeNumeric:
393 return d.numNumericCharCountBits
394 case dataModeAlphanumeric:
395 return d.numAlphanumericCharCountBits
396 case dataModeByte:
397 return d.numByteCharCountBits
398 default:
399 log.Panic("Unknown data mode")
400 }
401
402 return 0
403}
404
405// encodedLength returns the number of bits required to encode n symbols in
406// dataMode.

Callers 2

encodeDataRawMethod · 0.95
encodedLengthMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected