QR Code encoding and rendering.
Transform a QRCode into a canvas element.
qrCodeView : String -> Html msg
qrCodeView message =
QRCode.encode message
|> Result.map QRCode.toCanvas
|> Result.withDefault
(Html.text "Error while encoding to 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:
■■■■■■■ ■■■■ ■■■■■■■
■ ■ ■■■■ ■ ■
■ ■■■ ■ ■■■■■ ■ ■■■ ■
■ ■■■ ■ ■ ■ ■ ■■■ ■
■ ■■■ ■ ■■■■ ■ ■■■ ■
■ ■ ■ ■ ■
■■■■■■■ ■ ■ ■ ■■■■■■■
■ ■■
■■ ■ ■■ ■ ■ ■■■■■
■■ ■■■ ■■■■ ■■■ ■■
■ ■■ ■■ ■■■■■ ■■■■■■
■■ ■■■■ ■ ■
■ ■ ■■■ ■■■■ ■■
■■ ■■■ ■■
■■■■■■■ ■ ■ ■■ ■■■
■ ■ ■ ■ ■ ■
■ ■■■ ■ ■■■ ■
■ ■■■ ■ ■■ ■■■ ■■
■ ■■■ ■ ■ ■ ■ ■ ■ ■ ■
■ ■ ■ ■ ■ ■
■■■■■■■ ■■■ ■ ■■
QRCode type.