Crates.io | short_url |
lib.rs | short_url |
version | 1.0.0 |
source | src |
created_at | 2020-07-15 15:28:27.568232 |
updated_at | 2021-09-20 17:11:51.781968 |
description | A port of the short_url package in python for Rust |
homepage | https://github.com/tyhi/short_url-rs |
repository | https://github.com/tyhi/short_url-rs |
max_upload_size | |
id | 265471 |
size | 7,767 |
short_url is a crate that is ported from https://github.com/Alir3z4/python-short_url into Rust.
use short_url::UrlEncoder;
let encoder = UrlEncoder::new("mn6j2c4rv8bpygw95z7hsdaetxuk3fq", 24);
// Encode a url with id 1, and a min length of 5.
assert_eq!(String::from("867nv"), e.encode_url(1, 5));
// Decode a url into a usize.
assert_eq!(1, e.decode_url("867nv").unwrap());
Licensed under MIT as inherited from the orginal work at https://github.com/Alir3z4/python-short_url.