#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

#109 in Text processing

Download history 27366/week @ 2024-03-14 26006/week @ 2024-03-21 24738/week @ 2024-03-28 25441/week @ 2024-04-04 25775/week @ 2024-04-11 25486/week @ 2024-04-18 24748/week @ 2024-04-25 27548/week @ 2024-05-02 26269/week @ 2024-05-09 23460/week @ 2024-05-16 26838/week @ 2024-05-23 24719/week @ 2024-05-30 25726/week @ 2024-06-06 27043/week @ 2024-06-13 26758/week @ 2024-06-20 22272/week @ 2024-06-27

106,068 downloads per month
Used in 64 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
~47K SLoC