MCPcopy Create free account
hub / github.com/breck7/scroll / drawCodewords

Method drawCodewords

external/.qrcodegen.js:134–147  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

132 return o(d.length == a), d
133 }
134 drawCodewords(t) {
135 if (t.length != Math.floor(e.getNumRawDataModules(this.version) / 8)) throw new RangeError("Invalid argument")
136 let r = 0
137 for (let e = this.size - 1; e >= 1; e -= 2) {
138 6 == e && (e = 5)
139 for (let o = 0; o < this.size; o++)
140 for (let s = 0; s < 2; s++) {
141 const i = e - s,
142 a = 0 == ((e + 1) & 2) ? this.size - 1 - o : o
143 !this.isFunction[a][i] && r < 8 * t.length && ((this.modules[a][i] = n(t[r >>> 3], 7 - (7 & r))), r++)
144 }
145 }
146 o(r == 8 * t.length)
147 }
148 applyMask(t) {
149 if (t < 0 || t > 7) throw new RangeError("Mask value out of range")
150 for (let e = 0; e < this.size; e++)

Callers 1

constructorMethod · 0.95

Calls 3

getNumRawDataModulesMethod · 0.80
nFunction · 0.70
oFunction · 0.70

Tested by

no test coverage detected