QR codes complete, account settings finished!

+ refactored templates a little; this might need more work!
This commit is contained in:
ari melody 2025-01-26 20:09:18 +00:00
parent 1edc051ae2
commit 3450d879ac
Signed by: ari
GPG key ID: CF99829C92678188
13 changed files with 175 additions and 135 deletions

View file

@ -8,8 +8,21 @@ import (
"image"
"image/color"
"image/png"
"github.com/skip2/go-qrcode"
)
func GenerateQRCode(data string) (string, error) {
imgBytes, err := qrcode.Encode(data, qrcode.Medium, 256)
if err != nil {
return "", err
}
base64Img := base64.StdEncoding.EncodeToString(imgBytes)
return base64Img, nil
}
// vvv DEPRECATED vvv
const margin = 4
type QRCodeECCLevel int64
@ -20,7 +33,7 @@ const (
HIGH
)
func GenerateQRCode(data []byte) (string, error) {
func noDepsGenerateQRCode() (string, error) {
version := 1
size := 0