aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/constants.h
diff options
context:
space:
mode:
authorLeo Uino <leo@norisys.jp>2011-07-15 14:57:03 +0900
committerLeo Uino <leo@norisys.jp>2011-07-15 20:22:30 +0900
commitf7133a8a56650a2e5cefc66b6d9b87809a890b2e (patch)
tree3b22f8567ec2f2de13d7c3c030f7f4718099523a /lpg/libqr/constants.h
parenta5c8627f3152e9604bb65fef2e71015a66c82421 (diff)
downloadpdf-simple-sign-f7133a8a56650a2e5cefc66b6d9b87809a890b2e.tar.gz
pdf-simple-sign-f7133a8a56650a2e5cefc66b6d9b87809a890b2e.tar.xz
pdf-simple-sign-f7133a8a56650a2e5cefc66b6d9b87809a890b2e.zip
Remove (a few) magic numbers
Diffstat (limited to 'lpg/libqr/constants.h')
-rw-r--r--lpg/libqr/constants.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lpg/libqr/constants.h b/lpg/libqr/constants.h
index fbfadc8..e6cfa3c 100644
--- a/lpg/libqr/constants.h
+++ b/lpg/libqr/constants.h
@@ -3,6 +3,22 @@
#include <qr/types.h>
+/* XOR mask for format data: 101 0100 0001 0010 */
+#define QR_FORMAT_MASK (0x5412)
+
+/* Format info EC polynomial
+ * G(x) = x^10 + x^8 + x^5 + x^4 + x^2 + x + 1
+ */
+#define QR_FORMAT_POLY (0x537)
+
+/* Version info EC polynomial
+ * G(x) = x^12 + x^11 + x^10 + x^9 + x^8 + x^5 + x^2 + 1
+ */
+#define QR_VERSION_POLY (0x1F25)
+
+/* A QR-code word is always 8 bits, but CHAR_BIT might not be */
+#define QR_WORD_BITS (8)
+
extern const int QR_ALIGNMENT_LOCATION[40][7];
extern const int QR_DATA_WORD_COUNT[40][4];
/* See qr_get_rs_block_sizes() */