Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enzoh/motoko-qr
The Motoko QR Package
https://github.com/enzoh/motoko-qr
Last synced: 3 months ago
JSON representation
The Motoko QR Package
- Host: GitHub
- URL: https://github.com/enzoh/motoko-qr
- Owner: enzoh
- License: apache-2.0
- Created: 2019-11-09T22:46:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T00:03:56.000Z (over 3 years ago)
- Last Synced: 2024-04-19T01:32:59.099Z (7 months ago)
- Language: Modelica
- Homepage: https://sdk.dfinity.org
- Size: 159 KB
- Stars: 21
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-icp - enzoh/motoko-qr
- awesome-motoko - motoko-qr - A QR-code generator for the Motoko programming language. (Libraries / Algorithms)
README
# The QR Package
[![Build Status](https://github.com/enzoh/motoko-qr/workflows/build/badge.svg)](https://github.com/enzoh/motoko-qr/actions?query=workflow%3Abuild)
This package implements a QR-code generator for the Motoko programming language.
### Prerequisites
- [DFINITY SDK](https://sdk.dfinity.org/docs/download.html) v0.6.24
### Usage
Generate a QR-code.
```motoko
public func encode(
version : { #Version : Nat },
level : { #L; #M; #Q; #H },
mode : { #Alphanumeric; #EightBit; #Kanji; #Numeric },
text : Text
) : ?{ #Matrix : [[Bool]] }
```### Demo
Start a local internet computer.
```
dfx start
```Execute the following commands in another tab.
```
dfx canister create --all
dfx build
dfx canister install --all
dfx canister call demo encode '(variant{Version = 1}, variant{Q}, variant{Alphanumeric}, "HELLO WORLD")' | sed 's/#/█/g'
```