#unicode #security #unicode-text #text

unicode-security

根据 Unicode 技术标准 #39 规则检测 Unicode 使用可能存在的安全问题

8 个版本

0.1.1 2024年2月9日
0.1.0 2022年9月15日
0.0.6 2021年12月23日
0.0.5 2020年6月24日
0.0.2 2020年1月2日

#116 in 文本处理

Download history 25485/week @ 2024-04-21 26178/week @ 2024-04-28 27105/week @ 2024-05-05 24388/week @ 2024-05-12 25533/week @ 2024-05-19 24982/week @ 2024-05-26 25406/week @ 2024-06-02 26931/week @ 2024-06-09 26056/week @ 2024-06-16 26555/week @ 2024-06-23 27029/week @ 2024-06-30 28820/week @ 2024-07-07 28038/week @ 2024-07-14 28610/week @ 2024-07-21 31303/week @ 2024-07-28 31876/week @ 2024-08-04

122,339 每月下载量
66 个 crates 中使用 (通过 cedar-policy-validator)

MIT/Apache

450KB
5K SLoC

unicode-security

Build Status Current Version License: MIT/Apache-2.0

此 crate 提供了来自 UAX #39 Unicode 安全机制 的各种实用工具。


lib.rs:

根据 Unicode 技术标准 #39 规则检测 Unicode 使用可能存在的安全问题。

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" });
}

特性

unicode-security 支持一个 no_std 特性。这消除了对 std 的依赖,而是使用 core 中的等效函数。

crates.io

您可以通过将以下内容添加到您的 Cargo.toml 来在项目中使用此包

[dependencies]
unicode-security = "0.0.1"

依赖项

~0.8–1.2MB
~47K SLoC