encode

fun encode(contents: String, ecLevel: ErrorCorrectionLevel = ErrorCorrectionLevel.M, characterSet: String? = null, version: Int? = null): BitMatrix

Encodes contents into a tight QR BitMatrix: one cell per module, no quiet zone, no scaling. Add margins and scale at render time with toSvg() / toPng() (see io.github.yuroyami.kiteqr.render).

Parameters

ecLevel

error-correction level (L < M < Q < H redundancy).

characterSet

forces a specific ECI charset (e.g. "UTF-8", "Shift_JIS").

version

pins the QR version (1..40); omit to auto-size.