Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/integrity.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
index.mjs: sha384-m4b9mo8rku6/YQbV1e52UTglSzniaJVeyuq4NnpxRZtq9UrxWXKj+/Mx9MvtPRhK
index.js: sha384-jh47I3nzhofHfyfvgZFdmqUk4CYrsTIaq9LwhVmsWOFiX88x2h46P06/aDeaEtXp
nano.mjs: sha384-avNlMHLjqxeTtXysYm13MNj05YYIEl5Fg3itpc7p/JdjS3ULukmDYKaqUMtBj6tT
index.mjs: sha384-ix/UIenTZ8IyJxa+sJjONUP54ZVdea4Lx1HLnQ6H19foghKqyGi2tWwKqEBZ/fMP
index.js: sha384-rMLAHwGIF45U925zCR19N4xrcJ0oWFePEJ1n97/WvrJF+ON9OcD7oky9FnZJjeaj
nano.mjs: sha384-XThBBrKCQC9Alnv0+HEu/eQjYCSDEkmYTNMzQyLrfFpf4HDpj/Mhti8J8kTD0liW
extras/svg.mjs: sha384-Gk8g8nmt6RvyscmK2SxGhYHjrlr8PGRa9CD96IKO9EfLBGE1Wpj/pT8TgbuUXYXM
extras/svg.js: sha384-VYnYxwUAQvjDtTiso2ihlfJcfZY60ZgYYdd5YKEO1B4BtZ3P7fxQ5WNuPPG/i8Np
extras/node_export.mjs: sha384-jY8CQmq1wxq5w4nuvoBv5cQ+YlO4CAy1qLQ1ZzisUY+YKNSk0IiiQBG6xzZ4t7il
Expand All @@ -11,4 +11,4 @@ extras/vue.mjs: sha384-Q4U/qU20x7la3XGJDH1okfzFYN5r+AahC/KAu3xJi5vmOj0GP
extras/vue.js: sha384-lkJRxa/w/MmxmQCuZWCv3qKGlSyuRD86eaGUWktxjO/n7pcUstsLUW2COHlYDYQ4
extras/errors.mjs: sha384-LaUpr3MpI+ZWjDG8L54lwBzgymdm+C1fijP3Z3HukZOFOn3nmRUtgK5aTmOSVm/q
extras/errors.js: sha384-lpwl8zlB1GwhvS1ftgUv4mCvOhlixuRa8fRag2aZ2PEEPKQ++l+IjhZL8lhbZMVe
webcomponent.mjs: sha384-9dDat7/8CJ6E17L+k4st+cuCTZKpoAQ8TnkM+IqePpen71TrCZHaqfWzeD+qXg48
webcomponent.mjs: sha384-QTlW/1U8Fi4zgSsbEx+i8+CHNfzzIWxgw8hH0hc4qwVBJN5omqCsXJ6a7d8aDzKd
8 changes: 4 additions & 4 deletions docs/stats.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
index.mjs: 6898 bytes / 3670 bytes (compressed)
index.js: 6914 bytes / 3661 bytes (compressed)
nano.mjs: 3763 bytes / 2159 bytes (compressed)
index.mjs: 6897 bytes / 3667 bytes (compressed)
index.js: 6913 bytes / 3661 bytes (compressed)
nano.mjs: 3762 bytes / 2160 bytes (compressed)
extras/svg.mjs: 1333 bytes / 945 bytes (compressed)
extras/svg.js: 1350 bytes / 942 bytes (compressed)
extras/node_export.mjs: 1069 bytes / 785 bytes (compressed)
Expand All @@ -11,4 +11,4 @@ extras/vue.mjs: 1059 bytes / 686 bytes (compressed)
extras/vue.js: 1066 bytes / 684 bytes (compressed)
extras/errors.mjs: 287 bytes / 342 bytes (compressed)
extras/errors.js: 287 bytes / 340 bytes (compressed)
webcomponent.mjs: 8634 bytes / 4442 bytes (compressed)
webcomponent.mjs: 8633 bytes / 4443 bytes (compressed)
2 changes: 1 addition & 1 deletion src/qr/errorCorrection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const calculateEC = (versionBytes, correction) => {
const result = makeUint8Array(size);
size = 0;
for (const bs of blocks) {
for (let i = 0, prev; size !== prev; ++i) {
for (let i = 0, prev = -1; prev < size; ++i) {
prev = size;
for (const block of bs) {
if (i < block.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/qr/score.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const matches = 0b00000000001_00000000001;
export const scoreCode = ({ size, _data }, score = 0, totalOn = 0) => {
for (let i = 0; i < size; ++i) {
for (let n = 0; n < 2; ++n) {
for (let j = 0, state = 0, consec = 0, last; j < size; ++j) {
for (let j = 0, state = 0, consec, last = 2; j < size; ++j) {
const cur = _data[n ? i * size + j : j * size + i] & 1;
totalOn += cur;
state = ((state >> 1) | initial) & (pattern ^ (cur - 1));
if (state & matches) {
score += 40;
}
if (cur !== last) {
if (cur ^ last) {
consec = 0;
}
last = cur;
Expand Down
Loading