QR Code encoding and rendering.
Error correction level. Provides the following error correction capability:
Transform a string into a result Error
or a QRCode using Quartile ErrorCorrection.
Transform a string with a given ErrorCorrection into a result Error or a QRCode.
Transform a QRCode into a svg element.
qrCodeView : String -> Html msg
qrCodeView message =
QRCode.encode message
|> Result.map QRCode.toSvg
|> Result.withDefault
(Html.text "Error while encoding to QRCode.")Tip: You can determine the size of the generated svg setting
width and height styles.
Transform a QRCode into a string.
"Hello World!"
|> QRCode.encode
|> Result.map QRCode.toString
|> Result.withDefault "Error while encoding to QRCode."Returns:
■■■■■■■ ■■■■ ■■■■■■■
■ ■ ■■■■ ■ ■
■ ■■■ ■ ■■■■■ ■ ■■■ ■
■ ■■■ ■ ■ ■ ■ ■■■ ■
■ ■■■ ■ ■■■■ ■ ■■■ ■
■ ■ ■ ■ ■
■■■■■■■ ■ ■ ■ ■■■■■■■
■ ■■
■■ ■ ■■ ■ ■ ■■■■■
■■ ■■■ ■■■■ ■■■ ■■
■ ■■ ■■ ■■■■■ ■■■■■■
■■ ■■■■ ■ ■
■ ■ ■■■ ■■■■ ■■
■■ ■■■ ■■
■■■■■■■ ■ ■ ■■ ■■■
■ ■ ■ ■ ■ ■
■ ■■■ ■ ■■■ ■
■ ■■■ ■ ■■ ■■■ ■■
■ ■■■ ■ ■ ■ ■ ■ ■ ■ ■
■ ■ ■ ■ ■ ■
■■■■■■■ ■■■ ■ ■■Possible enconding errors.
QRCode type.