You can always be shorter.
Shorter is a simple URL shortener written in Rust. It stores the urls in-memory or in a file.
I am using bpaf to parse the command line arguments and some essential features to deliever the good cli experience.
Shorter uses the md5 hash of the long url to generate a unique id. The id is then converted to base62 and the first 7 characters are used as the short url.
It is unlikely that two urls will have the same hash, but if it happens, the short url will be the same. In that case, the short url will be overwritten.
I will add a feature to handle collisions in the future.
Usage: COMMAND ...
Available options:
-h, --help Prints help information
-V, --version Prints version information
Available commands:
get, g Get an url by uid
save, s Save an url
delete, d Delete an url by uid
list, l List all saved urls
cargo build --release
cargo test
- pathbuf: todo!
- closure: todo!
- serde: todo!
- construct! todo!
- Add a feature to handle collisions
- Detailed error handling
- Command descriptions
- Guard for invalid urls
This project is licensed under the terms of the MIT license.