From 4782e117a5e9071ba618cfa92a590a78554c24a9 Mon Sep 17 00:00:00 2001 From: vodofrede Date: Tue, 26 Oct 2021 16:22:45 +0200 Subject: [PATCH] Added example to readme --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 12 ++++++++++++ src/main.rs | 7 +++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 4f138f1..729442a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 3 [[package]] name = "lore" -version = "1.0.0" +version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 0a8ac90..da49313 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lore" -version = "1.0.0" +version = "1.0.1" edition = "2018" description = "Zero-dependency hashing algorithms" license = "BSD-3-Clause" diff --git a/README.md b/README.md index 5b5588a..eac91a1 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,15 @@ Hashing algorithms. Currently only implements md5. Doesn't use any dependencies. Performance/stability not guaranteed. + +## Example + +```rust +use lore::md5; + +fn main() { + let input = "lol xd"; + let digest = md5::hash(input); + assert_eq!(digest, "982d7f24f8985a6baa5cf129acc73561"); +} +``` diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..a13ddd3 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,7 @@ +use lore::md5; + +fn main() { + let input = "lol xd"; + let digest = md5::hash(input); + assert_eq!(digest, "982d7f24f8985a6baa5cf129acc73561"); +}