Crate precis_profiles[−][src]
Expand description
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
extern crate precis_profiles;
use precis_core::profile::PrecisFastInvocation;
use precis_profiles::Nickname;
use std::borrow::Cow;
fn main() {
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));
}crates.io
You can use this package in your project by adding the following
to your Cargo.toml:
[dependencies]
precis-profiles = "0.1.2"Structs
Nickname Profile. Nicknames or display names in messaging and text conferencing technologies; petnames for devices, accounts, and people; and other uses of nicknames, display names, or petnames IANA Considerations section for more details.
OpaqueString Profile Profile designed to deal with passwords and other opaque strings in security and application protocols. Replaces: The SASLprep profile of Stringprep. Look at the IANA Considerations section for more details.
UsernameCaseMapped Profile. Profile designed to deal with usernames in security and application protocols. It replaces the SASLprep profile of Stringprep. Look at the IANA Considerations section for more details.
UsernameCasePreserved Profile. Profile designed to deal with usernames in security and application protocols. It replaces the SASLprep profile of Stringprep. Look at the IANA Considerations section for more details.
Constants
The Unicode version of data