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 文本处理
122,339 每月下载量
在 66 个 crates 中使用 (通过 cedar-policy-validator)
450KB
5K SLoC
unicode-security
此 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