diff options
Diffstat (limited to 'openssl/src/sha.rs')
-rw-r--r-- | openssl/src/sha.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/openssl/src/sha.rs b/openssl/src/sha.rs index e74eb29f..811a5321 100644 --- a/openssl/src/sha.rs +++ b/openssl/src/sha.rs @@ -16,15 +16,13 @@ //! ```rust //! use openssl::sha; //! -//! fn main() { -//! let mut hasher = sha::Sha256::new(); +//! let mut hasher = sha::Sha256::new(); //! -//! hasher.update(b"Hello, "); -//! hasher.update(b"world"); +//! hasher.update(b"Hello, "); +//! hasher.update(b"world"); //! -//! let hash = hasher.finish(); -//! println!("Hashed \"Hello, world\" to {}", hex::encode(hash)); -//! } +//! let hash = hasher.finish(); +//! println!("Hashed \"Hello, world\" to {}", hex::encode(hash)); //! ``` //! //! On the other hand, if you already have access to all of the data you woud like to hash, you @@ -34,10 +32,8 @@ //! ```rust //! use openssl::sha::sha256; //! -//! fn main() { -//! let hash = sha256(b"your data or message"); -//! println!("Hash = {}", hex::encode(hash)); -//! } +//! let hash = sha256(b"your data or message"); +//! println!("Hash = {}", hex::encode(hash)); //! ``` use libc::c_void; use std::mem; |