diff --git a/c/qrcodegen.c b/c/qrcodegen.c index 5bf50c2..892bf22 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -406,7 +406,7 @@ testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { // Returns the number of data bits that can be stored in a QR Code of the given version number, after // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. -// The result is in the range [208, 29648]. +// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. testable int getNumRawDataModules(int version) { assert(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); int result = (16 * version + 128) * version + 64; diff --git a/cpp/QrCode.hpp b/cpp/QrCode.hpp index 23a47b2..09ce1b3 100644 --- a/cpp/QrCode.hpp +++ b/cpp/QrCode.hpp @@ -222,9 +222,9 @@ class QrCode final { private: static std::vector getAlignmentPatternPositions(int ver); - // Returns the number of raw data modules (bits) available at the given version number. - // These data modules are used for both user data codewords and error correction codewords. - // This stateless pure function could be implemented as a 40-entry lookup table. + // Returns the number of data bits that can be stored in a QR Code of the given version number, after + // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. + // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. private: static int getNumRawDataModules(int ver); diff --git a/java/io/nayuki/qrcodegen/QrCode.java b/java/io/nayuki/qrcodegen/QrCode.java index 4b3d8b3..684ab12 100644 --- a/java/io/nayuki/qrcodegen/QrCode.java +++ b/java/io/nayuki/qrcodegen/QrCode.java @@ -682,9 +682,9 @@ public final class QrCode { } - // Returns the number of raw data modules (bits) available at the given version number. - // These data modules are used for both user data codewords and error correction codewords. - // This stateless pure function could be implemented as a 40-entry lookup table. + // Returns the number of data bits that can be stored in a QR Code of the given version number, after + // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. + // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. private static int getNumRawDataModules(int ver) { if (ver < 1 || ver > 40) throw new IllegalArgumentException("Version number out of range"); diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index 736653f..722c54c 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -642,9 +642,9 @@ var qrcodegen = new function() { }; - // Returns the number of raw data modules (bits) available at the given version number. - // These data modules are used for both user data codewords and error correction codewords. - // This stateless pure function could be implemented as a 40-entry lookup table. + // Returns the number of data bits that can be stored in a QR Code of the given version number, after + // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. + // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. QrCode.getNumRawDataModules = function(ver) { if (ver < 1 || ver > 40) throw "Version number out of range"; diff --git a/python/qrcodegen.py b/python/qrcodegen.py index 7a46cf9..666d658 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -521,9 +521,9 @@ class QrCode(object): @staticmethod def _get_num_raw_data_modules(ver): - """Returns the number of raw data modules (bits) available at the given version number. - These data modules are used for both user data codewords and error correction codewords. - This stateless pure function could be implemented as a 40-entry lookup table.""" + """Returns the number of data bits that can be stored in a QR Code of the given version number, after + all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. + The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.""" if not 1 <= ver <= 40: raise ValueError("Version number out of range") result = (16 * ver + 128) * ver + 64