yxk_h5_master/reqrcode/reqrcode.js

2 lines
54 KiB
JavaScript
Raw Permalink Normal View History

2025-08-28 15:21:09 +08:00
var _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 k = new _ac(d); var j = new Array(d << 1); for (var f = 0; f < d; f++) { var g = j.length; var i = f + 0.5; for (var h = 0; h < g; h += 2) { j[h] = (h >> 1) + 0.5; j[h + 1] = i } a._ad(j); _aa._ab(b, j); try { for (var h = 0; h < g; h += 2) { var e = b[Math.floor(j[h]) + qrcode.width * Math.floor(j[h + 1])]; if (e) { k._dq(h >> 1, f) } } } catch (c) { throw "Error._ab" } } return k }; _aa._ah = function (h, o, l, k, q, p, b, a, f, e, n, m, s, r, d, c, j, i) { var g = _ae._ag(l, k, q, p, b, a, f, e, n, m, s, r, 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 q = this._cr; var o = new _ac(q); o._bq(0, 0, 9, 9); o._bq(q - 8, 0, 8, 9); o._bq(0, q - 8, 9, 8); var n = this._ar.length; for (var m = 0; m < n; m++) { var p = this._ar[m] - 2; for (var r = 0; r < n; r++) { if ((m == 0 && (r == 0 || r == n - 1)) || (m == n - 1 && r == 0)) { continue } o._bq(this._ar[r] - 2, p, 5, 5) } } o._bq(6, 9, 1, q - 17); o._bq(9, 6, q - 17, 1); if (this._bs > 6) { o._bq(q - 11, 0, 3, 6); o._bq(0, q - 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 _ay () { return new Array(new _a3(1, new Array(), new _a2(7, new _a1(1, 19)), new _a2(10, new _a1(1, 16)), new _a2(13, new _a1(1, 13)), new _a2(17, new _a1(1, 9))), new _a3(2, new Array(6, 18), new _a2(10, new _a1(1, 34)),