pilcrowonpaper / oslo

A collection of auth-related utilities
https://oslo.js.org
MIT License
1.06k stars 35 forks source link

Adding function to convert uri into image #20

Closed sheecet closed 9 months ago

sheecet commented 9 months ago

In this link we have const qrcode = createQRCode(uri); as placeholders. I had reviewed a few libraries to add an implemention to my project. I think this one is the most stable https://kazuhikoarase.github.io/qrcode-generator/js/demo/ and pure js. Using it is pretty straight forward I was wondering if I can add it as a function under oslo/otp

import { qrcode } from "$lib/qrcode"
var typeNumber = 0;
var errorCorrectionLevel = 'M';
var qr = qrcode(typeNumber, errorCorrectionLevel);
qr.addData(uri);
qr.make();
console.log(qr.createImgTag())
pilcrowonpaper commented 9 months ago

Similar to password hashing, it would be better to rely on something native to the runtime, and I'd rather not rely on WASM. I don't think it fits the library in the first place too