charCountBits returns the number of bits used to encode the length of a data segment of type dataMode.
(dataMode dataMode)
| 388 | // charCountBits returns the number of bits used to encode the length of a data |
| 389 | // segment of type dataMode. |
| 390 | func (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. |
no outgoing calls
no test coverage detected