mirror of
https://github.com/MedzikUser/rust-crypto-utils
synced 2024-08-14 23:54:22 +00:00
update
This commit is contained in:
parent
7ef23c602a
commit
9c2fb0c8e9
2 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
## [0.2.1] - 2022-06-18
|
||||
### Added
|
||||
- Examples
|
||||
- [Examples](https://github.com/MedzikUser/rust-crypto-utils/tree/v0.2.1/examples)
|
||||
### Changed
|
||||
- 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() {
|
||||
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());
|
||||
|
||||
println!("sha256 = `{}`", hex::encode(sha256));
|
||||
println!("sha256 = `{}`", hex::encode(sha256));
|
||||
|
||||
let sha512 = CryptographicHash::hash(Algorithm::SHA512, input.as_bytes());
|
||||
|
||||
println!("sha512 = `{}`", hex::encode(sha512));
|
||||
println!("sha512 = `{}`", hex::encode(sha512));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue