//qrcode-kotlin/io.github.g0dkar.qrcode/QRCode/encode

encode

[common]\

@JvmOverloads

fun encode(type: Int = typeForDataAndECL(data, errorCorrectionLevel), maskPattern: MaskPattern = MaskPattern.PATTERN000): Array<Array<QRCodeSquare?>>

Computes and encodes the data of this object into a QR Code. This method returns the raw data of the QR Code.

If you just want to render (create) a QR Code image, you are probably looking for the renderShaded method.

Return

The byte matrix of the encoded QRCode.

Parameters

common

   
type type value for the QRCode computation. Between 0 and 40. Read more about it here. Defaults to an automatically calculated value based on data and the errorCorrectionLevel.
maskPattern Mask Pattern to apply to the final QR Code. Basically changes how the QR Code looks at the end. Read more about it here. Defaults to MaskPattern.PATTERN000.

See also

 
QRCode.Companion.typeForDataAndECL
ErrorCorrectionLevel
MaskPattern
QRCode.renderShaded