ngubin/key-n 问题修复 & 功能扩展

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

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

ngubin/key-n

Composer 安装命令:

composer require ngubin/key-n

包简介

Generation a unique short key from the number.

README 文档

README

Generating a unique short key from the number.

A simple library for converting a number into a string key and back. You can use to shorten long numbers to unique keys.

Latest Version Total Downloads

Example Usage

Creating a key from a number:

You can only encode an integer greater than or equal to one.

use KeyN\Make\Key62;

$instance = Key62::make();
$key = $instance->encode(100000);

Set your own character set to create keys:

use KeyN\Make\Key62;

$characters = 'wWpJbH8nIDed1Evq5OcToF2ZuXsayz7RrtP490ixSKC3GM6gYkNVhBUQmLlfAj';

$instance = Key62::make($characters);
$key = $instance->encode(100000);

Getting the number from the key:

You can decode the key if all of its characters are in the class set.

use KeyN\Make\Key62;

$instance = Key62::make();
$number = $instance->decode('Gh1a');

License

This project is released under the MIT License.

© 2020 Nik Gubin, All rights reserved.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固