diff --git a/java/src/main/java/io/nayuki/qrcodegen/QrSegment.java b/java/src/main/java/io/nayuki/qrcodegen/QrSegment.java index 4e7118f..3a8b534 100644 --- a/java/src/main/java/io/nayuki/qrcodegen/QrSegment.java +++ b/java/src/main/java/io/nayuki/qrcodegen/QrSegment.java @@ -151,10 +151,10 @@ public final class QrSegment { else if (assignVal < (1 << 7)) bb.appendBits(assignVal, 8); else if (assignVal < (1 << 14)) { - bb.appendBits(2, 2); + bb.appendBits(0b10, 2); bb.appendBits(assignVal, 14); } else if (assignVal < 1_000_000) { - bb.appendBits(6, 3); + bb.appendBits(0b110, 3); bb.appendBits(assignVal, 21); } else throw new IllegalArgumentException("ECI assignment value out of range"); diff --git a/python/qrcodegen.py b/python/qrcodegen.py index 5bd7bd1..8022a79 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -746,10 +746,10 @@ class QrSegment: elif assignval < (1 << 7): bb.append_bits(assignval, 8) elif assignval < (1 << 14): - bb.append_bits(2, 2) + bb.append_bits(0b10, 2) bb.append_bits(assignval, 14) elif assignval < 1000000: - bb.append_bits(6, 3) + bb.append_bits(0b110, 3) bb.append_bits(assignval, 21) else: raise ValueError("ECI assignment value out of range") diff --git a/rust/src/lib.rs b/rust/src/lib.rs index cbc44e2..d21c090 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1059,10 +1059,10 @@ impl QrSegment { if assignval < (1 << 7) { bb.append_bits(assignval, 8); } else if assignval < (1 << 14) { - bb.append_bits(2, 2); + bb.append_bits(0b10, 2); bb.append_bits(assignval, 14); } else if assignval < 1_000_000 { - bb.append_bits(6, 3); + bb.append_bits(0b110, 3); bb.append_bits(assignval, 21); } else { panic!("ECI assignment value out of range"); diff --git a/typescript-javascript/qrcodegen.ts b/typescript-javascript/qrcodegen.ts index 7f0244b..2d1d5f2 100644 --- a/typescript-javascript/qrcodegen.ts +++ b/typescript-javascript/qrcodegen.ts @@ -811,10 +811,10 @@ namespace qrcodegen { else if (assignVal < (1 << 7)) appendBits(assignVal, 8, bb); else if (assignVal < (1 << 14)) { - appendBits(2, 2, bb); + appendBits(0b10, 2, bb); appendBits(assignVal, 14, bb); } else if (assignVal < 1000000) { - appendBits(6, 3, bb); + appendBits(0b110, 3, bb); appendBits(assignVal, 21, bb); } else throw "ECI assignment value out of range";