| Crates.io | link_rs |
| lib.rs | link_rs |
| version | 0.1.2 |
| created_at | 2022-06-16 10:34:31.897776+00 |
| updated_at | 2022-06-16 13:13:46.36646+00 |
| description | Generate hash-id based URLs and QR codes for use in URL shortening services. |
| homepage | |
| repository | https://github.com/OliverBrotchie/link-rs |
| max_upload_size | |
| id | 607403 |
| size | 44,437 |
link-rsGenerate hash-id based URLs and QR codes for use in URL shortening services.
A simple implementation of a URL generation module. Allows for qr-code generation using the qrcode library.
Basic Example:
mod link_rs::LinkGenerator
fn main() {
let mut link_gen = LinkGenerator::new("/some/redirect", 10);
let link = link_gen::generate_url()
println!("{:?}", link) // Link { key: "vq5ejng0p6", url: "/some/redirect/vq5ejng0p6" }
}
To see a complete implementation of a url shortening service, please take a look at the actix-web example.
cargo.tomllink_rs = { version = "0.1.2", features = ["qrcode"] }
cargo testcargo test