update
This commit is contained in:
parent
7ef23c602a
commit
9c2fb0c8e9
|
@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
## [0.2.1] - 2022-06-18
|
## [0.2.1] - 2022-06-18
|
||||||
### Added
|
### Added
|
||||||
- Examples
|
- [Examples](https://github.com/MedzikUser/rust-crypto-utils/tree/v0.2.1/examples)
|
||||||
### Changed
|
### Changed
|
||||||
- update rust crate jsonwebtoken to 8.1.1
|
- update rust crate jsonwebtoken to 8.1.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crypto_utils::sha::{CryptographicHash, Algorithm};
|
use crypto_utils::sha::{Algorithm, CryptographicHash};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let input = "This is a input text to be hashed";
|
let input = "This is a input text to be hashed";
|
||||||
|
@ -11,9 +11,9 @@ fn main() {
|
||||||
|
|
||||||
let sha256 = CryptographicHash::hash(Algorithm::SHA256, input.as_bytes());
|
let sha256 = CryptographicHash::hash(Algorithm::SHA256, input.as_bytes());
|
||||||
|
|
||||||
println!("sha256 = `{}`", hex::encode(sha256));
|
println!("sha256 = `{}`", hex::encode(sha256));
|
||||||
|
|
||||||
let sha512 = CryptographicHash::hash(Algorithm::SHA512, input.as_bytes());
|
let sha512 = CryptographicHash::hash(Algorithm::SHA512, input.as_bytes());
|
||||||
|
|
||||||
println!("sha512 = `{}`", hex::encode(sha512));
|
println!("sha512 = `{}`", hex::encode(sha512));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue