Skip to content
Snippets Groups Projects
Commit 658224d8 authored by Éloïs's avatar Éloïs
Browse files

[doc] create summary + add sha256 example

parent 213208af
No related branches found
No related tags found
No related merge requests found
Pipeline #8228 passed
...@@ -13,9 +13,19 @@ ...@@ -13,9 +13,19 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Handle [DEWIF](https://git.duniter.org/nodes/common/doc/blob/dewif/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md) format //! Handle [DEWIF][dewif-spec] format
//! //!
//! # Write ed25519 key-pair in DEWIF file //! See [DEWIF format specifications][dewif-spec].
//!
//! [dewif-spec]: https://git.duniter.org/documents/rfcs/blob/dewif/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md
//!
//! # Summary
//!
//! * [Write DEWIF file](#write-ed25519-key-pair-in-dewif-file)
//! * [Read DEWIF file](#read-dewif-file)
//!
//!
//! ## Write ed25519 key-pair in DEWIF file
//! //!
//! ``` //! ```
//! use dup_crypto::dewif::{Currency, G1_TEST_CURRENCY, write_dewif_v1_content}; //! use dup_crypto::dewif::{Currency, G1_TEST_CURRENCY, write_dewif_v1_content};
...@@ -40,7 +50,7 @@ ...@@ -40,7 +50,7 @@
//! ) //! )
//! ``` //! ```
//! //!
//! # Read DEWIF file //! ## Read DEWIF file
//! //!
//! ``` //! ```
//! use dup_crypto::dewif::{Currency, ExpectedCurrency, read_dewif_file_content}; //! use dup_crypto::dewif::{Currency, ExpectedCurrency, read_dewif_file_content};
......
...@@ -14,6 +14,24 @@ ...@@ -14,6 +14,24 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Provide wrappers for cryptographic hashs //! Provide wrappers for cryptographic hashs
//!
//! # Summary
//!
//! * [Compute Sha256 hash](#compute-sha256-hash)
//!
//! ## Compute sha256 hash
//!
//! ```
//! use dup_crypto::hashs::Hash;
//!
//! let hash: Hash = Hash::compute(b"datas");
//!
//! assert_eq!(
//! "958D41C80EF75834EFFC9CBE2E8AEE11AEDE28ADA596E876B8261EDF53266B40",
//! &hash.to_hex(),
//! );
//! ```
//!
use crate::bases::*; use crate::bases::*;
#[cfg(feature = "rand")] #[cfg(feature = "rand")]
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
//! - Keys can be converted to/from Base58 string format. //! - Keys can be converted to/from Base58 string format.
//! - Signatures can be converted to/from Base64 string format. //! - Signatures can be converted to/from Base64 string format.
//! //!
//! # Usage //! # Generate and use ed25519 key-pair
//! //!
//! ``` //! ```
//! use dup_crypto::keys::{KeyPair, PublicKey, Signator, Signature}; //! use dup_crypto::keys::{KeyPair, PublicKey, Signator, Signature};
......
...@@ -17,6 +17,16 @@ ...@@ -17,6 +17,16 @@
//! //!
//! `dup` means DUniter Protocols. //! `dup` means DUniter Protocols.
//! //!
//! ## Summary
//!
//! * [Handle DEWIF format](./dewif/index.html#handle-dewif-format)
//! * [Write DEWIF file](./dewif/index.html#write-ed25519-key-pair-in-dewif-file)
//! * [Read DEWIF file](./dewif/index.html#read-dewif-file)
//! * [Sha256](./hashs/index.html)
//! * [Compute Sha256 hash](./hashs/index.html#compute-sha256-hash)
//! * [Ed25519](./keys/index.html)
//! * [generate and use ed25519 key-pair](./keys/index.html#generate-and-use-ed25519-key-pair)
//!
#![deny( #![deny(
clippy::option_unwrap_used, clippy::option_unwrap_used,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment