dannyvilla/simtoken
Composer 安装命令:
composer require dannyvilla/simtoken
包简介
This package allows to create simple tokens from plain text containing only alphanumeric characters
README 文档
README
This package allows to create simple tokens by encoding plain text. For example if the plain text looks like this: "I'm me", after the encoding it will become like this: "5c6e54d5s5h89b9e".
Installation
Use the package manager composer to install Simtoken.
composer require dannyvilla/simtoken
Usage
require 'vendor/autoload.php'; $id = '100'; $encoded = SimToken::encode($id); // with salt and complexity 1 echo($encoded); // e8f8f8 $encoded = SimToken::encode($id, false, 2); // without salt and complexity 2 echo($encoded); // 188808880888 $encoded = SimToken::encode($id, true, 2); // with salt and complexity 2 echo($encoded); // b1h8b2h8b2h8 $encoded = SimToken::encode($id, false, 3); // without salt and complexity 3 echo($encoded); // 588888886888888868888888 $decoded = SimToken::decode($encoded, false, 3); // Decode the last encoded echo($decoded); // 100
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-08