Encoder

object Encoder

Functions

Link copied to clipboard
fun append8BitBytes(content: String, bits: BitArray, encoding: String?)
Link copied to clipboard
Link copied to clipboard
fun appendBytes(content: String, mode: Mode, bits: BitArray, encoding: String?)

Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".

Link copied to clipboard
fun appendKanjiBytes(content: String, bits: BitArray)
Link copied to clipboard
fun appendLengthInfo(numLetters: Int, version: Version?, mode: Mode, bits: BitArray)

Append length info. On success, store the result in "bits".

Link copied to clipboard
fun encode(content: String, ecLevel: ErrorCorrectionLevel, hints: HashMap<EncodeHintType, Any?>? = null): QRCode
Link copied to clipboard
fun getNumDataBytesAndNumECBytesForBlockID(numTotalBytes: Int, numDataBytes: Int, numRSBlocks: Int, blockID: Int, numDataBytesInBlock: IntArray, numECBytesInBlock: IntArray)

Get number of data bytes and number of error correction bytes for block id "blockID". Store the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of JISX0510:2004 (p.30)

Link copied to clipboard
fun interleaveWithECBytes(bits: BitArray, numTotalBytes: Int, numDataBytes: Int, numRSBlocks: Int): BitArray

Interleave "bits" with corresponding error correction bytes. On success, store the result in "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details.

Link copied to clipboard
fun terminateBits(numDataBytes: Int, bits: BitArray)

Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24).