1
나는 libqrencode을 사용하고 있습니다.
버전 1 (21x21) 및 ECC 수준 H으로 QR 코드를 원합니다. http://www.qrcode.com/en/about/version.html에 따르면 나는 17 개의 Numerics를 가질 수 있습니다. 그래서 내가 할 :숫자 QRCode를 올바르게 인코딩하는 방법은 무엇입니까?
QRcode *result;
QRinput *input = QRinput_new2(1, QR_ECLEVEL_H);
unsigned char *data = new unsigned char[17];
for(int i = 0; i < 17; i++) {
data[i] = 0;
}
QRinput_append(input, QR_MODE_NUM, 17, data);
result = QRcode_encodeInput(input);
int idx = 0;
printf("%d\n", result->width);
for(int i = 0; i < result->width; i++) {
for(int j = 0; j < result->width; j++) {
if(result->data[idx] & 1) {
printf("%d", 1);
} else {
printf("%d", 0);
}
idx++;
}
printf("\n");
}
그러나 내 데이터가 내 프로그램은 동일한 출력을 반환합니다.
내가 여기에없는 이유는 무엇입니까?