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

Method numBitsToPadToCodeword

version.go:3018–3024  ·  view source on GitHub ↗

numBitsToPadToCodeword returns the number of bits required to pad data of length numDataBits upto the nearest codeword size.

(numDataBits int)

Source from the content-addressed store, hash-verified

3016// numBitsToPadToCodeword returns the number of bits required to pad data of
3017// length numDataBits upto the nearest codeword size.
3018func (v qrCodeVersion) numBitsToPadToCodeword(numDataBits int) int {
3019 if numDataBits == v.numDataBits() {
3020 return 0
3021 }
3022
3023 return (8 - numDataBits%8) % 8
3024}
3025
3026// symbolSize returns the size of the QR Code symbol in number of modules (which
3027// is both the width and height, since QR codes are square). The QR Code has

Callers 2

addPaddingMethod · 0.80

Calls 1

numDataBitsMethod · 0.95

Tested by 1