定制 devknown/alpha-id 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

devknown/alpha-id

最新稳定版本:0.0.1

Composer 安装命令:

composer require devknown/alpha-id

包简介

Convert any integer to a short alphanumeric version.

README 文档

README

AlphaID - Convert any integer to a short alphanumeric version

Release PHP Composer License PHP version

AlphaID

AlphaID let you convert any integer to a short alphanumeric version. It can be useful for generating short, unique, and obfuscated identifiers.

AlphaID Library Versions

These versions should all function harmoniously, allowing for encoding in one language and decoding in another.

Requirements

PHP 7.3 and later.

Installation (Composer)

You can install the bindings via Composer. Run the following command:

composer require devknown/alpha-id

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Getting Started

Simple usage looks like:

// convert number to a short string
echo \Devknown\AlphaID::convert(258456357951); // Output: '4y7exoH'

// recover the original number from the short string
echo \Devknown\AlphaID::recover('4y7exoH'); // Output: 258456357951

Convert with key:

use Devknown\AlphaID;

AlphaID::config('my_key');

echo AlphaID::convert(258456357951);
// the output this time will be '4ymMZq9'

echo AlphaID::recover('4ymMZq9');
// the recover output this time will be 258456357951

License

AlphaID is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-17