nayuki / QR-Code-generator

High-quality QR Code generator library in Java, TypeScript/JavaScript, Python, Rust, C++, C.

Home Page:https://www.nayuki.io/page/qr-code-generator-library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal for a new function (C version)

opened this issue · comments

Hello, first of all thanks for this wonderful library!

At line 210 of https://github.com/nayuki/QR-Code-generator/blob/master/c/qrcodegen.c there is a small script that in my opinion should be turned into a public function that would take the text, minVersion, and maxVersion then return the minimum possible qr code version that could be used for that text. This would be useful when setting the size of uint8_t qrcode[]; and uint8_t tempBuffer[];.

Thanks in advance,
Developer-39

It's an interesting design choice. We're talking kilobytes of memory here, and minimizing the dynamic memory usage might matter to an embedded system but certainly not to desktop computing. Extracting this piece of code out to a separate function would increase the differences between this C (no-heap) port and other language ports. I'll have to think about it, but don't expect a timely conclusion.