#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

#89 in Text processing

Download history 24977/week @ 2024-02-04 25562/week @ 2024-02-11 25668/week @ 2024-02-18 23144/week @ 2024-02-25 24754/week @ 2024-03-03 27595/week @ 2024-03-10 26203/week @ 2024-03-17 25884/week @ 2024-03-24 24968/week @ 2024-03-31 24856/week @ 2024-04-07 26059/week @ 2024-04-14 25485/week @ 2024-04-21 26178/week @ 2024-04-28 27105/week @ 2024-05-05 24388/week @ 2024-05-12 22702/week @ 2024-05-19

102,942 downloads per month
Used in 60 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.8–1.2MB
~48K SLoC