Crates.io | shorturl-core |
lib.rs | shorturl-core |
version | 0.1.0 |
source | src |
created_at | 2021-05-22 05:28:17.455929 |
updated_at | 2021-05-22 05:28:17.455929 |
description | 短网址核心功能 |
homepage | https://r7n.cc |
repository | https://github.com/r7n/shorturl-core |
max_upload_size | |
id | 400719 |
size | 3,397 |
用于将原始网址转换成6个字符长度的短网址。
[dependencies]
shorturl-core = { git = "https://github.com/r7n/shorturl-core.git" }
use shorturl_core::short_url;
let url:String = "r7n.cc".to_string();
let shorted_url:String = short_url(url); # 3TrFk7
println!("{}", shorted_url);
use shorturl_core::short_url_with_seed;
let url:String = "r7n.cc".to_string();
let shorted_url:String = short_url_with_seed(url, 1u32); # 3KC4r5
println!("{}", shorted_url);