Added example to readme

This commit is contained in:
Frederik Palmø 2021-10-26 16:22:45 +02:00
parent 954848a11a
commit 4782e117a5
4 changed files with 21 additions and 2 deletions

2
Cargo.lock generated
View file

@ -4,4 +4,4 @@ version = 3
[[package]]
name = "lore"
version = "1.0.0"
version = "1.0.1"

View file

@ -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"

View file

@ -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");
}
```

7
src/main.rs Normal file
View file

@ -0,0 +1,7 @@
use lore::md5;
fn main() {
let input = "lol xd";
let digest = md5::hash(input);
assert_eq!(digest, "982d7f24f8985a6baa5cf129acc73561");
}