[][src]Crate unicode_security

Detect possible security problems with Unicode usage according to Unicode Technical Standard #39 rules.

extern crate unicode_security;

use unicode_security::GeneralSecurityProfile;

fn main() {
    let ch = 'µ'; // U+00B5 MICRO SIGN
    let allowed = 'µ'.identifier_allowed();
    println!("{}", ch);
    println!("The above char is {} in unicode identifiers.",
             if allowed { "allowed" } else { "restricted" });
}

features

unicode-security supports a no_std feature. This eliminates dependence on std, and instead uses equivalent functions from core.

crates.io

You can use this package in your project by adding the following to your Cargo.toml:

[dependencies]
unicode-security = "0.0.1"

Re-exports

pub use confusable_detection::skeleton;
pub use general_security_profile::GeneralSecurityProfile;
pub use mixed_script::MixedScript;
pub use restriction_level::RestrictionLevel;
pub use restriction_level::RestrictionLevelDetection;

Modules

confusable_detection

Confusable detection

general_security_profile

Utilities for working with the General Security Profile for identifiers

mixed_script

Mixed-script detection

restriction_level

For detecting the restriction level a string conforms to

Constants

UNICODE_VERSION

The version of Unicode that this version of unicode-security is based on.