Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/magiclen/qrcode-segments-optimizer

This library is used for optimizing the QR code segments.
https://github.com/magiclen/qrcode-segments-optimizer

qrcode rust

Last synced: 9 days ago
JSON representation

This library is used for optimizing the QR code segments.

Awesome Lists containing this project

README

        

QR Code Segments Optimizer
====================

[![CI](https://github.com/magiclen/qrcode-segments-optimizer/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/qrcode-segments-optimizer/actions/workflows/ci.yml)

This library is used for optimizing the QR code segments.

## Examples

```rust
use qrcode_generator::QrCodeEcc;
use url::Url;

let url = "https://magiclen.org/path/to/12345";
let ecc = QrCodeEcc::Low;

let naive_matrix = qrcode_generator::to_matrix(url, ecc).unwrap();

let url = Url::parse(url).unwrap();

let optimized_matrix = qrcode_generator::to_matrix_from_segments(
qrcode_segments_optimizer::make_segments_from_url(&url, ecc)
.unwrap()
.as_slice(),
ecc,
)
.unwrap();

assert!(optimized_matrix.len() < naive_matrix.len());
```

## Crates.io

TDB

## Documentation

TDB

## License

[MIT](LICENSE)