skywalker-labs/constant-time-encoding
最新稳定版本:v1.0.0
Composer 安装命令:
composer require skywalker-labs/constant-time-encoding
包简介
Constant-time implementations of RFC 4648 encoding (Base64, Base32, Hex) and other variants (Base64UrlSafe, Base64DotSlash, Base32Hex)
关键字:
README 文档
README
Constant-time implementations of RFC 4648 encoding (Base64, Base32, Hex) and other variants.
This library aims to offer character encoding functions that do not leak information about what you are encoding/decoding via processor cache misses.
Features
- Constant-Time Encoding/Decoding: Prevents cache-timing attacks.
- Multiple Encodings:
- Base64 (RFC 4648)
- Base64UrlSafe (URL-safe variant)
- Base64DotSlash (Crypt version,
./[A-Z][a-z][0-9]) - Base64DotSlashOrdered (Ordered variant,
[.-9][A-Z][a-z]) - Base32 (RFC 4648)
- Base32Hex (RFC 4648 base32hex)
- Hex (Base16)
- Security: Uses
pack()andunpack()instead ofchr()andord()for safer bit manipulation. - Robust: Strict padding validation (optional).
Requirements
- PHP 7.4 or newer (including PHP 8.x).
Installation
composer require skywalker-labs/constant-time-encoding
Usage
You can use the Skywalker\ConstantTime\Encoding class as a facade for all encoding methods, or use specific classes directly.
Using the Encoding Facade
use Skywalker\ConstantTime\Encoding; // Sample data $data = random_bytes(32); // Base64 echo Encoding::base64Encode($data), "\n"; // Base32 (Uppercase) echo Encoding::base32EncodeUpper($data), "\n"; // Base32 (Standard) echo Encoding::base32Encode($data), "\n"; // Hex (Base16) echo Encoding::hexEncode($data), "\n"; echo Encoding::hexEncodeUpper($data), "\n";
Using Specific Classes
If you only need a specific encoding, you can import the relevant class directly:
use Skywalker\ConstantTime\Base64; use Skywalker\ConstantTime\Base32; use Skywalker\ConstantTime\Hex; $data = random_bytes(32); // Encode $b64 = Base64::encode($data); $b32 = Base32::encode($data); $hex = Hex::encode($data); // Decode $raw = Base64::decode($b64);
Output Example
1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1
Security
This library was designed to eliminate cache-timing side-channels from encoding operations. It is intended for use in cryptographic contexts where timing leaks could expose sensitive data.
Support
If your company uses this library in their products or services, you may be interested in purchasing a support contract from Skywalker Labs.
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
skywalker-labs/constant-time-encoding 适用场景与选型建议
skywalker-labs/constant-time-encoding 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「base64」 「base32」 「encoding」 「rfc4648」 「hex」 「base16」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 skywalker-labs/constant-time-encoding 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 skywalker-labs/constant-time-encoding 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 skywalker-labs/constant-time-encoding 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
integration of the Panda encoding services into the Symfony2 Framework
Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation
Implementation of bitcoin cash base32 addresses
FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle
Base 32 encoder / decoder
AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 37
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-15