PixelPass
PixelPass
PixelPass is a node library which helps in generating QR Code for VCs with smaller data size. It can also be used for decoding the VC generated. PixelPass also has Kotlin, Swift and Java artifacts available.
Features
Create QR Code for given data
Uses zlib compression and base45 encoding
Decode QR data encoded by PixelPass
Snapshots
Below snapshots provide the mobile platform native artifacts along with the java library:
Kotlin: Index of /repositories/snapshots/io/mosip/pixelpass-aar
Swift: GitHub - mosip/pixelpass-ios-swift: Swift library to generate QR code from VC and decode the data
Java: Index of /repositories/snapshots/io/mosip/pixelpass-jar
Installation
As a node project:
npm i @mosip/pixelpass
To include PixelPass in your Swift project, follow the below steps:
Clone the PixelPass library locally.
Create a new Swift project.
Add package dependency: PixelPass
APIs
Below are the APIs provided by the PixelPass library:
To Generate QR Data:
The API returns a zlib compressed and base45 encoded string with header prepended if provided.
To Generate QR Code:
The API returns a base64 encoded PNG image with header prepended if provided.
To Decode the QR Code:
The API returns a base45 decoded and zlib decompressed string.
Errors / Exceptions
Shall you encounter any errors while using the APIs, please refer to the below:
Cannot read properties of null (reading 'length') - This error denotes that the string passed to encode is null.
Cannot read properties of undefined (reading 'length') - This error denotes that the string passed to encode is undefined.
byteArrayArg is null or undefined. - This error denotes that the string passed to encode is null or undefined.
utf8StringArg is null or undefined. - This error denotes that the string passed to decode is null or undefined.
utf8StringArg has incorrect length. - This error denotes that the string passed to decode is of invalid length.
Invalid character at position X. - This error denotes that the string passed to decode is invalid with an unknown character then base45 character set. Also denotes the invalid character position.
incorrect data check - This error denotes that the string passed to decode is invalid.
PixelPass & Inji Mobile Integration:
The below diagram shows how Inji Mobile utilises PixelPass library.
\
Last updated