#unicode #security #unicode-text #text

unicode-security

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

9 releases

0.1.2 Sep 12, 2024
0.1.1 Feb 9, 2024
0.1.0 Sep 15, 2022
0.0.6 Dec 23, 2021
0.0.2 Jan 2, 2020

#147 in Text processing

Download history 31263/week @ 2024-08-17 30843/week @ 2024-08-24 31871/week @ 2024-08-31 30978/week @ 2024-09-07 30328/week @ 2024-09-14 29944/week @ 2024-09-21 28993/week @ 2024-09-28 27183/week @ 2024-10-05 30058/week @ 2024-10-12 36151/week @ 2024-10-19 38712/week @ 2024-10-26 45157/week @ 2024-11-02 44605/week @ 2024-11-09 47420/week @ 2024-11-16 47211/week @ 2024-11-23 41630/week @ 2024-11-30

188,248 downloads per month
Used in 85 crates (via cedar-policy-validator)

MIT/Apache

455KB
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

~1.5MB
~42K SLoC