ricmoo / QRCode

QR code generation library in C, optimized for low-power devices, such as Arduino.
Other
638 stars 202 forks source link

ChatGPT proposed code, refering to function in this library, which does not exist #41

Open 369Martin369 opened 1 month ago

369Martin369 commented 1 month ago

Hi, Code ChatGPT suggested:

String generateQRCode(const String& data) { QRCode qrcode; uint8_t qrcodeData[qrcode_getBufferSize(3)]; qrcode_initText(&qrcode, qrcodeData, 3, 0, data.c_str());

String qrCodeHtml = "<img src=\"data:image/png;base64,"; qrCodeHtml += qrcode_getQRCode(&qrcode); qrCodeHtml += "\">";

return qrCodeHtml; }

But..."qrcode_getQRCode" is not declared in qrcode.h!: How comes that ChatGPT thinks this is part of Richard Moore's library??

ricmoo commented 1 month ago

CharGPT will often hallucinate. You cannot take its suggestions at face value and will often have to do additional research beyond code it proposes.

ricmoo commented 1 month ago

(my low-level libraries tend to be exclusively C, so if you see C++ syntax it is likely a hallucination)