Skip to main content
Version: 3.1.0

What is a QR Code

A QR code (Quick Response code) is a type of matrix barcode (or two-dimensional barcode) that can store a wide range of information and is easily scanned using a smartphone camera.

In the context of Blockchain, a QR code serves as a convenient and secure method to represent wallet addresses and transaction information. Instead of manually typing long and complex addresses, users can scan a QR code to initiate transactions, exchange public keys, or access specific content on a Blockchain. This simplifies the process of sending and receiving digital currencies, enhancing user experience and reducing the risk of errors in transactions.

For more information, see this Wikipedia article.

QR Code Generation as Texture2D

Generate QR Code as Texture2D generates a QR code from a text string of specified size in pixels as a Texture2D.

This function requires inputs as follows:

  • Content 1 : The text to store in the QR code. Must not be empty.
  • Width 2 : The width in pixels of the QR code. Must be greater than 0.
  • Height 3 : The height in pixels of the QR code. Must be greater than 0.
  • Margin 4 : The margin in pixels around the QR code. Must be greater than or equal to 0.
  • Encoding 5 : The character set to use for encoding the QR code.
  • Error Correction Level 6 : The error correction level, ranging from low (~7%) to high (~30%). This variable refers to the degree of redundancy built into the code to ensure data integrity even if the code is damaged or partially obscured. A higher error correction level increases the QR code's resilience to damage, but it also increases the code's size.

QR Code Generation as Texture2D

If the generation is successful, the value QR Code 7 will return the QR code as a Texture2D with encoded content in it.

QR Code Generation as Byte Array

Generate QR Code as Byte Array generates a QR code from a text string of specified size in pixels as a byte array.

This function requires inputs as follows:

  • Content 1 : The text to store in the QR code. Must not be empty.
  • Width 2 : The width in pixels of the QR code. Must be greater than 0.
  • Height 3 : The height in pixels of the QR code. Must be greater than 0.
  • Margin 4 : The margin in pixels around the QR code. Must be greater than or equal to 0.
  • Encoding 5 : The character set to use for encoding the QR code.
  • Error Correction Level 6 : The error correction level, ranging from low (~7%) to high (~30%). This variable refers to the degree of redundancy built into the code to ensure data integrity even if the code is damaged or partially obscured. A higher error correction level increases the QR code's resilience to damage, but it also increases the code's size.

QR Code Generation as Byte Array

If the generation is successful, the value QR Code 7 will return the QR code as a byte array with encoded content in it.

Conversion of QR Code Byte Array to Texture2D

Convert QR Code Byte Array to Texture2D converts a byte array containing a QR code to a Texture2D.

This function requires inputs as follows:

  • Byte Array 1 : The byte array with the QR code to convert.
  • Width 2 : The width in pixels of the QR code. Must match the original width used during QR code generation.
  • Height 3 : The height in pixels of the QR code. Must match the original height used during QR code generation.

Conversion of QR Code Byte Array to Texture2D

If the conversion is successful, the value QR Code 4 will return the QR code as a Texture2D with encoded content in it.

note

The third-party library ZXing-C++ is used to generate the QR codes.