carry0987/cony 问题修复 & 功能扩展

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

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

carry0987/cony

最新稳定版本:1.0.4

Composer 安装命令:

composer require carry0987/cony

包简介

Cony is a PHP library for convert integer into alphabet, and reversely too

关键字:

README 文档

README

Packgist
Cony is a PHP library for convert integer into alphabet, and reversely too

Installation

composer require carry0987/cony

Note You can install bcmath extension in order to get better performance

Usage

require dirname(__DIR__).'/vendor/autoload.php';

use carry0987\Cony\Cony;

echo Cony::toNumeric('test'); // 4544743
echo '<br />';
echo Cony::toAlphanumeric(4544743); // test

If you want the alphaID to be at least 3 letter long, use the $padUp argument.

In most cases this is better than totally random ID generators because this can easily avoid duplicate ID's.

For example if you correlate the alpha ID to an auto incrementing ID in your database, you're done.

Cony::toAlphanumeric(4540899, 3); // test
Cony::toNumeric('test', 3); // 4540899

Although this function's purpose is to just make the ID short - and not so much secure, with third argument secureKey you can optionally supply a password to make it harder to calculate the corresponding numeric ID.

Cony::toAlphanumeric(11282993, 3, 'heuh2ui12'); // test
Cony::toNumeric('test', 3, 'heuh2ui12'); // 11282993

And, for final, you can easy transform alphanumeric result:

Cony::toAlphanumeric(21663528, 0, null, Cony::TRANSFORM_UPPERCASE); // B2TFK
Cony::toAlphanumeric(21663528, 0, null, Cony::TRANSFORM_LOWERCASE); // b2tfk

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固