horde/stringprep 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

horde/stringprep

最新稳定版本:v2.0.0beta1

Composer 安装命令:

composer require horde/stringprep

包简介

Internationalized strings preparation library

README 文档

README

Unicode string preparation for authentication and protocol identifiers. Provides both legacy RFC 3454 Stringprep and modern RFC 7564 PRECIS profiles, backed by PHP's ext-intl with no bundled vendor dependencies.

Requires PHP 8.1+ and ext-intl.

Stringprep profiles (RFC 3454)

Frozen to Unicode 3.2. Used by older protocol specifications.

Profile Class RFC Purpose
SASLprep SaslPrepProfile 4013 SASL usernames and passwords
Nameprep NameprepProfile 3491 Internationalized domain names
iSCSI IscsiProfile 3722 iSCSI naming
Nodeprep NodeprepProfile 6122 App A XMPP node identifiers
Resourceprep ResourceprepProfile 6122 App B XMPP resource identifiers
PolicyMIB PolicyMibProfile 4011 Policy-based management
Trace TraceProfile 4505 Anonymous SASL

PRECIS profiles (RFC 7564)

Unicode-version-agile. Recommended for new implementations.

Profile Class RFC Purpose
UsernameCaseMapped UsernameCaseMappedProfile 8265 Usernames (case-insensitive)
UsernameCasePreserved UsernameCasePreservedProfile 8265 Usernames (case-sensitive)
OpaqueString OpaqueStringProfile 8265 Passwords
Nickname NicknameProfile 8266 Chat/display nicknames

Usage

All profiles implement ProfileInterface with the same apply() method:

use Horde\Stringprep\SaslPrepProfile;
use Horde\Stringprep\OpaqueStringProfile;
use Horde\Stringprep\ProfileInterface;

// Legacy stringprep
$saslprep = new SaslPrepProfile();
$username = $saslprep->apply($input, ProfileInterface::MODE_QUERY);

// Modern PRECIS
$opaque = new OpaqueStringProfile();
$password = $opaque->apply($input, ProfileInterface::MODE_STORE);

MODE_STORE (default) rejects unassigned codepoints. MODE_QUERY allows them.

See doc/UPGRADING.md for migration from the bundled lib/ Znerol implementation.

统计信息

  • 总下载量: 43
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 7
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2023-12-22