phoneticpw

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From phoneticpw-0.0.1 To trunk

2024-09-14
03:50
Docs. Leaf check-in: f353d1bbf0 user: jan tags: trunk
03:37
Move from old repo. check-in: 83017d4ad3 user: jan tags: trunk, phoneticpw-0.0.1
01:55
initial empty check-in check-in: baa174d1b3 user: jan tags: trunk

Changes to src/lib.rs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Random phonetic password generator.
//!
//! # Features
//! | Feature            | Function
//! |--------------------|----------
//! | `filter-offensive` | Enable offensive filter.
//!
//! Notes:
//! - Enabling the `filter-offensive` feature enables offensive filtering in
//!   [`Generator`]s by default, but it can be disabled using
//!   [`Generator::filter_offensive()`].

#![cfg_attr(docsrs, feature(doc_cfg))]

use rand::{prelude::*, thread_rng};






|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Random phonetic password generator.
//!
//! # Features
//! | Feature            | Function
//! |--------------------|----------
//! | `filter-offensive` | Enable "offensive" filter.
//!
//! Notes:
//! - Enabling the `filter-offensive` feature enables "offensive" filtering in
//!   [`Generator`]s by default, but it can be disabled using
//!   [`Generator::filter_offensive()`].

#![cfg_attr(docsrs, feature(doc_cfg))]

use rand::{prelude::*, thread_rng};

508
509
510
511
512
513
514


515
516
517
518
519
520
521
  #[must_use]
  pub fn length(mut self, len: usize) -> Self {
    assert!(len > 0, "length must be greater than zero");
    self.len = len;
    self
  }



  #[cfg(feature = "filter-offensive")]
  #[cfg_attr(docsrs, doc(cfg(feature = "filter-offensive")))]
  #[must_use]
  pub const fn filter_offensive(mut self, f: bool) -> Self {
    self.filter_offensive = f;
    self
  }







>
>







508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
  #[must_use]
  pub fn length(mut self, len: usize) -> Self {
    assert!(len > 0, "length must be greater than zero");
    self.len = len;
    self
  }

  /// Attempt to filter out passwords that end up being "offensive" or
  /// containing "offensive" substrings.
  #[cfg(feature = "filter-offensive")]
  #[cfg_attr(docsrs, doc(cfg(feature = "filter-offensive")))]
  #[must_use]
  pub const fn filter_offensive(mut self, f: bool) -> Self {
    self.filter_offensive = f;
    self
  }