QR codes complete, account settings finished!
+ refactored templates a little; this might need more work!
This commit is contained in:
parent
1edc051ae2
commit
3450d879ac
13 changed files with 175 additions and 135 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue