当前位置:网站首页>#yyds干货盘点#stringprep --- 因特网字符串预备
#yyds干货盘点#stringprep --- 因特网字符串预备
2022-04-23 18:41:00 【D八哥卷】
在标识因特网上的事物(例如主机名),经常需要比较这些标识是否(相等)。 这种比较的具体执行可能会取决于应用域的不同,例如是否要区分大小写等等。 有时也可能需要限制允许的标识为仅由“可打印”字符组成。
RFC 3454 定义了在因特网协议中 Unicode 字符串的“预备”过程。 在将字符串连线传输之前,它们会先使用预备过程进行处理,之后它们将具有特定的标准形式。 该 RFC 定义了一系列表格,它们可以被组合为选项配置。 每个配置必须定义所使用的表格,stringprep 过程的其他可选项也是配置的组成部分。 stringprep 配置的一个例子是 nameprep,它被用于国际化域名。模块 stringprep 仅公开了来自 RFC 3454 的表格。 由于这些如果表格如果表示为字典或列表将会非常庞大,该模块在内部使用 Unicode 字符数据库。 该模块本身的源代码是使用 mkstringprep.py 工具生成的。因此,这些表格以函数而非数据结构的形式公开。 在 RFC 中有两种表格:集合与映射。 对于集合,stringprep 提供了“特征函数”,即如果形参是集合的一部分则返回值为 True 的函数。 对于映射,它提供了映射函数:它会根据给定的键返回所关联的值。 以下是模块中所有可用函数的列表。stringprep.in_table_a1(code)
确定 code 是否属于 tableA.1 (Unicode 3.2 中的未分配码位)。
stringprep.in_table_b1(code)
确定 code 是否属于 tableB.1 (通常映射为空值)。
stringprep.map_table_b2(code)
返回 code 依据 tableB.2 (配合 NFKC 使用的大小写转换映射) 所映射的值。
stringprep.map_table_b3(code)
返回 code 依据 tableB.3 (不附带正规化的大小写折叠映射) 所映射的值。
stringprep.in_table_c11(code)
确定 code 是否属于 tableC.1.1 (ASCII 空白字符)。
stringprep.in_table_c12(code)
确定 code 是否属于 tableC.1.2 (非 ASCII 空白字符)。
stringprep.in_table_c11_c12(code)
确定 code 是否属于 tableC.1 (空白字符,C.1.1 和 C.1.2 的并集)。
stringprep.in_table_c21(code)
确定 code 是否属于 tableC.2.1 (ASCII 控制字符)。
stringprep.in_table_c22(code)
确定 code 是否属于 tableC.2.2 (非 ASCII 控制字符)。
stringprep.in_table_c21_c22(code)
确定 code 是否属于 tableC.2 (控制字符,C.2.1 和 C.2.2 的并集)。
stringprep.in_table_c3(code)
确定 code 是否属于 tableC.3 (私有使用)。
stringprep.in_table_c4(code)
确定 code 是否属于 tableC.4 (非字符码位)。
stringprep.in_table_c5(code)
确定 code 是否属于 tableC.5 (替代码)。
stringprep.in_table_c6(code)
确定 code 是否属于 tableC.6 (不适用于纯文本)。
stringprep.in_table_c7(code)
确定 code 是否属于 tableC.7 (不适用于规范表示)。
stringprep.in_table_c8(code)
确定 code 是否属于 tableC.8 (改变显示属性或已弃用)。
stringprep.in_table_c9(code)
确定 code 是否属于 tableC.9 (标记字符)。
stringprep.in_table_d1(code)
确定 code 是否属于 tableD.1 (带有双向属性 "R" 或 "AL" 的字符)。
stringprep.in_table_d2(code)
确定 code 是否属于 tableD.2 (带有双向属性 "L" 的字符)。
版权声明
本文为[D八哥卷]所创,转载请带上原文链接,感谢
https://blog.51cto.com/u_15477882/5248714
边栏推荐
- 22年字节跳动飞书人力套件三面面经
- K210 serial communication
- 关于unity文件读取的操作(一)
- Teach you to quickly rename folder names in a few simple steps
- The first leg of the national tour of shengteng AI developer creation and enjoyment day was successfully held in Xi'an
- CISSP certified daily knowledge points (April 14, 2022)
- 机器学习实战 -朴素贝叶斯
- Daily network security certification test questions (April 14, 2022)
- Ionic instruction set order from creation to packaging
- 22 year flying Book manpower Kit
猜你喜欢

ESP32 LVGL8. 1 - slider slider (slider 22)

Machine learning theory (7): kernel function kernels -- a way to help SVM realize nonlinear decision boundary

Use of regular expressions in QT

ESP32 LVGL8. 1 - checkbox (checkbox 23)

Custom prompt box MessageBox in QT

Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système

教你用简单几个步骤快速重命名文件夹名

Teach you to quickly rename folder names in a few simple steps

Imx6 debugging LVDS screen technical notes

ESP32 LVGL8. 1 - arc (arc 19)
随机推荐
机器学习理论之(8):模型集成 Ensemble Learning
Const keyword, variable and function are decorated with const
Halo open source project learning (VII): caching mechanism
Connection mode of QT signal and slot connect() and the return value of emit
CISSP certified daily knowledge points (April 15, 2022)
回路-通路
[popular science] CRC verification (I) what is CRC verification?
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
数据库上机实验四(数据完整性与存储过程)
Creation and use of QT dynamic link library
Excel intercept text
ESP32 LVGL8. 1 - anim animation (anim 16)
STM32学习记录0008——GPIO那些事1
CISSP certified daily knowledge points (April 14, 2022)
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
Deeply understand what new and make in golang are and what are the differences?
Halo 开源项目学习(七):缓存机制
Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
14个py小游戏源代码分享第二弹
Daily CISSP certification common mistakes (April 11, 2022)