定制 nave-wata/base-conversion 二次开发

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

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

nave-wata/base-conversion

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nave-wata/base-conversion

包简介

This is a simple PHP class to convert numbers from one base to another.

README 文档

README

This is a simple PHP class to convert numbers from one base to another.

It provides methods to perform conversions between binary, decimal, and hexadecimal numbers. It can also perform conversions between arbitrary radix numbers.

Installation

composer require nave-wata/base-conversion

Usage

use NaveWata\BaseConversion\BaseConversion;

// Convert from binary
BaseConversion::binaryToDecimal('1111');        // 15
BaseConversion::binaryToHexadecimal('1111');    // F

// Convert from decimal
BaseConversion::decimalToBinary('2');           // 10
BaseConversion::decimalToHexadecimal('15');     // F

// Convert from hexadecimal
BaseConversion::hexadecimalToBinary('F');       // 1111
BaseConversion::hexadecimalToDecimal('F');      // 15

// Custom conversion
$custom = new BaseConversion('abcdefghijklmnopqrstuvwxyz');

$custom->decimalToCustom('25');                  // z
$custom->customToDecimal('z');                   // 25

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-03