precis-profiles

Crates.ioprecis-profiles
lib.rsprecis-profiles
version0.1.11
sourcesrc
created_at2021-11-02 09:31:42.89861
updated_at2024-07-30 13:54:35.790343
descriptionImplementation of the PRECIS Framework: Preparation, Enforcement, and Comparison of Internationalized Strings Representing Usernames and Passwords as defined in rfc8265; and Nicknames as defined in rfc8266.
homepagehttps://github.com/sancane/precis
repositoryhttps://github.com/sancane/precis
max_upload_size
id475628
size1,985,786
Santiago Carot-Nemesio (sancane)

documentation

https://docs.rs/precis-profiles

README

Docs Crates.io

precis-profiles

PRECIS Framework: Preparation, Enforcement, and Comparison of Internationalized Strings in Application Protocols as described in rfc8264

This crate implements the next PRECIS profiles:

  • rfc8265. Preparation, Enforcement, and Comparison of Internationalized Strings Representing Usernames and Passwords.
  • rfc8266. Preparation, Enforcement, and Comparison of Internationalized Strings Representing Nicknames

Examples

assert_eq!(Nickname::prepare("Guybrush Threepwood"),
  Ok(Cow::from("Guybrush Threepwood")));
assert_eq!(Nickname::enforce("   Guybrush     Threepwood  "),
  Ok(Cow::from("Guybrush Threepwood")));
assert_eq!(Nickname::compare("Guybrush   Threepwood  ",
  "guybrush threepwood"), Ok(true));

Contributing

Patches and feedback are welcome.

Donations

If you find this project helpful, you may consider making a donation:

Bitcoin QR Code Ethereum QR Code

License

This project is licensed under either of

say thanks

Commit count: 115

cargo fmt