recycledbeans/is-base64
Composer 安装命令:
composer require recycledbeans/is-base64
包简介
Adds a quick and easy method for determining whether a string is base64-encoded.
README 文档
README
From time to time, I've found it necessary to validate whether a bit of text is already encoded in base64. Since PHP does not include an easy function to do this, I decided to write this. This package does one simple thing: it adds some nice helper functions to know whether a text string is base64-encoded or not.
Installation
You can easily install with composer:
composer require recycledbeans/is-base64
Usage
is_base64()
<?php $is_b64 = is_base64('I am not base64-encoded'); // returns false $is_b64 = is_base64('SSBhbSBiYXNlNjQtZW5jb2RlZAo='); // returns true
is_base64_encode()
Useful when you do not want to have to check whether something is encoded before encoding. Will ensure that the string is base64-encoded and encode it if the string was not previously.
$my_encoded_string = is_base64_encode($_REQUEST['could_be_base64_encoded_or_not']); // returns base64-encoded string
is_base64_decode()
Useful when you do not want to have to check whether something is encoded before decoding. Will return the string value whether the original string was already base64-encoded or not.
$my_encoded_string = is_base64_decode($_REQUEST['could_be_base64_encoded_or_not']); // returns decoded string
Examples
$my_encoded_string = $_REQUEST['should_be_encoded']; if (! is_base64($my_encoded_string)) { $my_encoded_string = base64_encode($my_encoded_string); }
recycledbeans/is-base64 适用场景与选型建议
recycledbeans/is-base64 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 61.75k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 06 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「base64」 「base64_encode」 「encoded」 「base64 encoded」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 recycledbeans/is-base64 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 recycledbeans/is-base64 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 recycledbeans/is-base64 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
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.
base64 image verification captcha library for webman plugin
A reusable base API client for use with remote services.
Microweber security scanner is a php antimalware/antivirus scanner script written in php for scan your project.
A CakePHP plugin for using secure, non-incremental IDs for entities
统计信息
- 总下载量: 61.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-13