This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
green-pass-simple/js/llqrcode.js

2 lines
52 KiB
JavaScript
Raw Permalink Normal View History

2021-11-20 17:35:01 +01:00
_aa = {}; _aa._ab = function (f, e) { var d = qrcode.width; var b = qrcode.height; var c = true; for (var g = 0; g < e.length && c; g += 2) { var a = Math.floor(e[g]); var h = Math.floor(e[g + 1]); if (a < -1 || a > d || h < -1 || h > b) { throw "Error._ab " } c = false; if (a == -1) { e[g] = 0; c = true } else { if (a == d) { e[g] = d - 1; c = true } } if (h == -1) { e[g + 1] = 0; c = true } else { if (h == b) { e[g + 1] = b - 1; c = true } } } c = true; for (var g = e.length - 2; g >= 0 && c; g -= 2) { var a = Math.floor(e[g]); var h = Math.floor(e[g + 1]); if (a < -1 || a > d || h < -1 || h > b) { throw "Error._ab " } c = false; if (a == -1) { e[g] = 0; c = true } else { if (a == d) { e[g] = d - 1; c = true } } if (h == -1) { e[g + 1] = 0; c = true } else { if (h == b) { e[g + 1] = b - 1; c = true } } } }; _aa._af = function (b, d, a) { var l = new _ac(d); var k = new Array(d << 1); for (var g = 0; g < d; g++) { var h = k.length; var j = g + 0.5; for (var i = 0; i < h; i += 2) { k[i] = (i >> 1) + 0.5; k[i + 1] = j } a._ad(k); _aa._ab(b, k); try { for (var i = 0; i < h; i += 2) { var e = (Math.floor(k[i]) * 4) + (Math.floor(k[i + 1]) * qrcode.width * 4); var f = b[Math.floor(k[i]) + qrcode.width * Math.floor(k[i + 1])]; qrcode.imagedata.data[e] = f ? 255 : 0; qrcode.imagedata.data[e + 1] = f ? 255 : 0; qrcode.imagedata.data[e + 2] = 0; qrcode.imagedata.data[e + 3] = 255; if (f) { l._dq(i >> 1, g) } } } catch (c) { throw "Error._ab" } } return l }; _aa._ah = function (h, o, l, k, r, q, b, a, f, e, n, m, t, s, d, c, j, i) { var g = _ae._ag(l, k, r, q, b, a, f, e, n, m, t, s, d, c, j, i); return _aa._af(h, o, g) }; function _a1(b, a) { this.count = b; this._fc = a; this.__defineGetter__("Count", function () { return this.count }); this.__defineGetter__("_dm", function () { return this._fc }) } function _a2(a, c, b) { this._bm = a; if (b) { this._do = new Array(c, b) } else { this._do = new Array(c) } this.__defineGetter__("_bo", function () { return this._bm }); this.__defineGetter__("_dn", function () { return this._bm * this._fo }); this.__defineGetter__("_fo", function () { var e = 0; for (var d = 0; d < this._do.length; d++) { e += this._do[d].length } return e }); this._fb = function () { return this._do } } function _a3(k, l, h, g, f, e) { this._bs = k; this._ar = l; this._do = new Array(h, g, f, e); var j = 0; var b = h._bo; var a = h._fb(); for (var d = 0; d < a.length; d++) { var c = a[d]; j += c.Count * (c._dm + b) } this._br = j; this.__defineGetter__("_fd", function () { return this._bs }); this.__defineGetter__("_as", function () { return this._ar }); this.__defineGetter__("_dp", function () { return this._br }); this.__defineGetter__("_cr", function () { return 17 + 4 * this._bs }); this._aq = function () { var r = this._cr; var o = new _ac(r); o._bq(0, 0, 9, 9); o._bq(r - 8, 0, 8, 9); o._bq(0, r - 8, 9, 8); var n = this._ar.length; for (var m = 0; m < n; m++) { var q = this._ar[m] - 2; for (var s = 0; s < n; s++) { if ((m == 0 && (s == 0 || s == n - 1)) || (m == n - 1 && s == 0)) { continue } o._bq(this._ar[s] - 2, q, 5, 5) } } o._bq(6, 9, 1, r - 17); o._bq(9, 6, r - 17, 1); if (this._bs > 6) { o._bq(r - 11, 0, 3, 6); o._bq(0, r - 11, 6, 3) } return o }; this._bu = function (i) { return this._do[i.ordinal()] } } _a3._bv = new Array(31892, 34236, 39577, 42195, 48118, 51042, 55367, 58893, 63784, 68472, 70749, 76311, 79154, 84390, 87683, 92361, 96236, 102084, 102881, 110507, 110734, 117786, 119615, 126325, 127568, 133589, 136944, 141498, 145311, 150283, 152622, 158308, 161089, 167017); _a3.VERSIONS = _ay(); _a3._av = function (a) { if (a < 1 || a > 40) { throw "bad arguments" } return _a3.VERSIONS[a - 1] }; _a3._at = function (b) { if (b % 4 != 1) { throw "Error _at" } try { return _a3._av((b - 17) >> 2) } catch (a) { throw "Error _av" } }; _a3._aw = function (d) { var b = 4294967295; var f = 0; for (var c = 0; c < _a3._bv.length; c++) { var a = _a3._bv[c]; if (a == d) { return this._av(c + 7) } var e = _ax._gj(d, a); if (e < b) { f = c + 7; b = e } } if (b <= 3) { return this._av(f) } return null }; function