|
32 | 32 | //! password-based authentication. Do not use this API to derive cryptographic |
33 | 33 | //! keys: see the "key derivation" usage example below. |
34 | 34 | //! |
35 | | -#![cfg_attr(all(feature = "password-hash", feature = "std"), doc = "```")] |
36 | | -#![cfg_attr( |
37 | | - not(all(feature = "password-hash", feature = "std")), |
38 | | - doc = "```ignore" |
39 | | -)] |
40 | | -//! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 35 | +#![cfg_attr(all(feature = "alloc", feature = "getrandom"), doc = "```")] |
| 36 | +#![cfg_attr(not(all(feature = "alloc", feature = "getrandom")), doc = "```ignore")] |
| 37 | +//! # fn main() -> Result<(), Box<dyn core::error::Error>> { |
41 | 38 | //! use argon2::{ |
42 | 39 | //! password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, phc::Salt}, |
43 | 40 | //! Argon2 |
|
66 | 63 | //! |
67 | 64 | //! [pepper]: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#peppering |
68 | 65 | //! |
69 | | -#![cfg_attr(all(feature = "password-hash", feature = "std"), doc = "```")] |
70 | | -#![cfg_attr( |
71 | | - not(all(feature = "password-hash", feature = "std")), |
72 | | - doc = "```ignore" |
73 | | -)] |
74 | | -//! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 66 | +#![cfg_attr(all(feature = "alloc", feature = "getrandom"), doc = "```")] |
| 67 | +#![cfg_attr(not(all(feature = "alloc", feature = "getrandom")), doc = "```ignore")] |
| 68 | +//! # fn main() -> Result<(), Box<dyn core::error::Error>> { |
75 | 69 | //! use argon2::{ |
76 | 70 | //! password_hash::{ |
77 | 71 | //! phc::{PasswordHash, Salt}, |
|
118 | 112 | //! This API is useful for transforming a password into cryptographic keys for |
119 | 113 | //! e.g. password-based encryption. |
120 | 114 | //! |
121 | | -#![cfg_attr(all(feature = "password-hash", feature = "std"), doc = "```")] |
122 | | -#![cfg_attr( |
123 | | - not(all(feature = "password-hash", feature = "std")), |
124 | | - doc = "```ignore" |
125 | | -)] |
126 | | -//! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 115 | +#![cfg_attr(feature = "alloc", doc = "```")] |
| 116 | +#![cfg_attr(not(feature = "alloc"), doc = "```ignore")] |
| 117 | +//! # fn main() -> Result<(), Box<dyn core::error::Error>> { |
127 | 118 | //! use argon2::Argon2; |
128 | 119 | //! |
129 | 120 | //! let password = b"hunter42"; // Bad password; don't actually use! |
|
0 commit comments