#unicode #security #unicode-text #text

unicode-security

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

8 releases

0.1.1 Feb 9, 2024
0.1.0 Sep 15, 2022
0.0.6 Dec 23, 2021
0.0.5 Jun 24, 2020
0.0.2 Jan 2, 2020

#339 in Text processing

Download history 16015/week @ 2024-01-22 20239/week @ 2024-01-29 25518/week @ 2024-02-05 25618/week @ 2024-02-12 25303/week @ 2024-02-19 22911/week @ 2024-02-26 25646/week @ 2024-03-04 27427/week @ 2024-03-11 25856/week @ 2024-03-18 25634/week @ 2024-03-25 24880/week @ 2024-04-01 24747/week @ 2024-04-08 26579/week @ 2024-04-15 25234/week @ 2024-04-22 26031/week @ 2024-04-29 27293/week @ 2024-05-06

107,617 downloads per month
Used in 59 crates (via cedar-policy-validator)

MIT/Apache

450KB
5K SLoC

unicode-security

Build Status Current Version License: MIT/Apache-2.0

This crate exposes various utilities from UAX #39 Unicode Security Mechanisms


lib.rs:

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"

Dependencies

~0.9–1.3MB
~49K SLoC