Just another QR code library

Andrea Fontana nospam at example.org
Wed Oct 16 12:58:29 UTC 2024


Hey everyone,

I've been working on a small project lately and thought I'd share 
it with you all. It's a simple QR code generation library. It is 
based on Project Nayuki's library.

The main idea behind it was to create something that doesn't rely 
on any external dependencies. I know how annoying it can be when 
you want to do something simple like generating a QR code, and 
you end up having to install a bunch of packages. So, this 
library is completely self-contained.

Some key points about it:

- No external dependencies, as mentioned.
- You can tweak various generation parameters to get the QR code 
just how you want it.
- It supports exporting to different formats: SVG, PNG, and PPM.

If you need something straightforward, this might be useful.

`dub add qr`

```d
import qr;
import std.stdio;

void main()
{
    // ASCII art FTW
    QrCode("Hello D!").writeln();

    // Save as PNG. Look, Ma, no external deps!
    QrCode("Hello D!").save("simple-qr.png");
}
```

The code and docs are up on GitHub https://github.com/trikko/qr

Feel free to check it out, use it if you find it helpful, and let 
me know if you run into any issues or have suggestions for 
improvements.
Cheers!

Andrea Fontana


More information about the Digitalmars-d-announce mailing list