Crates.io | fiffy |
lib.rs | fiffy |
version | 0.1.10 |
source | src |
created_at | 2017-12-03 19:05:41.842637 |
updated_at | 2017-12-18 01:37:54.473098 |
description | A Rust library intended for simple file processing |
homepage | |
repository | https://github.com/SeanPrashad/Fiffy |
max_upload_size | |
id | 41590 |
size | 16,334 |
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Below you'll find what's required to build and compile Fiffy:
OSX/Unix installation (via Terminal):
curl -sSf https://static.rust-lang.org/rustup.sh | sh
Instructions for Microsoft Windows may be found here.
Additional installation instructions can be found here.
After installing the prerequisites listed above, you're ready to build!
git clone https://github.com/SeanPrashad/Fiffy.git
Or by downloading the .zip
equivalent, found here.
Note: Remember to extract the .zip
file to a location where you conduct your work!
cd
into the downloaded repository using your Terminal (or Git Bash if on Windows):cd whereMyReposAreStored/Fiffy/
cargo build
Note: Supply the --verbose
argument to get a more detailed output (ie. cargo build --verbose
)
The test suite can be found within src/lib.rs
in the module tests
. To build and run all test suites, simply use:
cargo test
Note: Supply the --verbose
argument to get a more detailed output (ie. cargo test --verbose
)
Rust comes with a built-in linter, Clippy, that's automatically configured to run when you build Fiffy.
To invoke Clippy on-demand, simply run:
cargo clippy
Note: Supply the --verbose
argument to get a more detailed output (ie. cargo clippy --verbose
). More information can be found here.
get_file_name(file_path: &str)
- returns the file name (as an OsString), given an absolute or relative pathlet file_path = "/home/kim/mydata.txt";
let file_name = get_file_name(file_path);
println!("{:?}", file_name); //prints "mydata.txt"
get_file_size(file_path: &str)
- returns the file size (as a u64), given an absolute or relative pathlet file_path = "/home/kim/mydata.txt";
let file_size = get_file_size(file_path);
println!("{:?}", file_size); //prints "129" - (e.g., the file is 129 bytes on disk)
generate_sha1(file_path: &str)
- returns the sha1 digest (as a String), given an absolute or relative pathlet text = "The quick brown fox jumps over the lazy dog"
let sha1_digest = generate_sha1(text);
println!("{:?}", sha1_digest); //prints "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
generate_md5(file_path: &str)
- returns the md5 digest (as a String), given an absolute or relative pathlet text = "The quick brown fox jumps over the lazy dog"
let md5_digest = generate_md5(text);
println!("{:?}", md5_digest); //prints "9e107d9d372bb6826bd81d3542a419d6"
Any and all contributions are welcome, regardless of your programming expertise. Please refer to CONTRIBUTING.md for details on how to get started.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.