precis-profiles 0.1.0

Implementation 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.
docs.rs failed to build precis-profiles-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: precis-profiles-0.1.13

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
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.0"