Skip to content

Commit

Permalink
Add simpler code snippet to the documentation (#515)
Browse files Browse the repository at this point in the history
Co-authored-by: Tony Arcieri <bascule@gmail.com>
  • Loading branch information
KSXGitHub and tarcieri authored Oct 30, 2023
1 parent e3ab257 commit 70a2b62
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sha1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
//!
//! # Usage
//!
//! ## One-shot API
//!
//! ```rust
//! use hex_literal::hex;
//! use sha1::{Sha1, Digest};
//!
//! let result = Sha1::digest(b"hello world");
//! assert_eq!(result[..], hex!("2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"));
//! ```
//!
//! ## Incremental API
//!
//! ```rust
//! use hex_literal::hex;
//! use sha1::{Sha1, Digest};
Expand Down
14 changes: 14 additions & 0 deletions sha2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
//!
//! # Usage
//!
//! ## One-shot API
//!
//! ```rust
//! use hex_literal::hex;
//! use sha2::{Sha256, Digest};
//!
//! let result = Sha256::digest(b"hello world");
//! assert_eq!(result[..], hex!("
//! b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
//! ")[..]);
//! ```
//!
//! ## Incremental API
//!
//! ```rust
//! use hex_literal::hex;
//! use sha2::{Sha256, Sha512, Digest};
Expand Down

0 comments on commit 70a2b62

Please sign in to comment.