From 87db45ef9cd335de802e9942792e73d03a319867 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Wed, 28 Jul 2021 17:38:03 +0000 Subject: [PATCH] Tweaked TypeScript code to correspond with other implementations for ease of auditing, without changing behavior. --- typescript-javascript/qrcodegen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript-javascript/qrcodegen.ts b/typescript-javascript/qrcodegen.ts index 809622b..dece093 100644 --- a/typescript-javascript/qrcodegen.ts +++ b/typescript-javascript/qrcodegen.ts @@ -545,7 +545,7 @@ namespace qrcodegen { else { const numAlign: int = Math.floor(this.version / 7) + 2; const step: int = (this.version == 32) ? 26 : - Math.ceil((this.size - 13) / (numAlign * 2 - 2)) * 2; + Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2; let result: Array = [6]; for (let pos = this.size - 7; result.length < numAlign; pos -= step) result.splice(1, 0, pos);