fix xsrf and added nonce
This commit is contained in:
parent
6476ebc781
commit
809627b538
208 changed files with 7166 additions and 4278 deletions
16
vendor/github.com/boombuler/barcode/qr/encoder.go
generated
vendored
16
vendor/github.com/boombuler/barcode/qr/encoder.go
generated
vendored
|
|
@ -54,8 +54,8 @@ func (e Encoding) String() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// Encode returns a QR barcode with the given content, error correction level and uses the given encoding
|
||||
func Encode(content string, level ErrorCorrectionLevel, mode Encoding) (barcode.Barcode, error) {
|
||||
// Encode returns a QR barcode with the given content and color scheme, error correction level and uses the given encoding
|
||||
func EncodeWithColor(content string, level ErrorCorrectionLevel, mode Encoding, color barcode.ColorScheme) (barcode.Barcode, error) {
|
||||
bits, vi, err := mode.getEncoder()(content, level)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -63,19 +63,23 @@ func Encode(content string, level ErrorCorrectionLevel, mode Encoding) (barcode.
|
|||
|
||||
blocks := splitToBlocks(bits.IterateBytes(), vi)
|
||||
data := blocks.interleave(vi)
|
||||
result := render(data, vi)
|
||||
result := render(data, vi, color)
|
||||
result.content = content
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func render(data []byte, vi *versionInfo) *qrcode {
|
||||
func Encode(content string, level ErrorCorrectionLevel, mode Encoding) (barcode.Barcode, error) {
|
||||
return EncodeWithColor(content, level, mode, barcode.ColorScheme16)
|
||||
}
|
||||
|
||||
func render(data []byte, vi *versionInfo, color barcode.ColorScheme) *qrcode {
|
||||
dim := vi.modulWidth()
|
||||
results := make([]*qrcode, 8)
|
||||
for i := 0; i < 8; i++ {
|
||||
results[i] = newBarcode(dim)
|
||||
results[i] = newBarCodeWithColor(dim, color)
|
||||
}
|
||||
|
||||
occupied := newBarcode(dim)
|
||||
occupied := newBarCodeWithColor(dim, color)
|
||||
|
||||
setAll := func(x int, y int, val bool) {
|
||||
occupied.Set(x, y, true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue