定制 navarr/binary-explode 二次开发

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

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

navarr/binary-explode

Composer 安装命令:

composer require navarr/binary-explode

包简介

Explode a number into it's binary components

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License
Tests Code Coverage Mutation Score

This package provides two functions usable to convert a number into an array of it's binary components.

Examples:

  1. [1]
  2. [2]
  3. [2, 1]
  4. [4]
  5. [4, 1]
  6. [4, 2]
  7. [4, 2, 1]

etc

Usage

Installation

composer require navarr/binary-explode`

Shared Interface

This package provides a shared interface, \Navarr\BinaryExploder\BinaryExploderInterface. This interface takes an int and returns an iterable<int> containing or generating the binary components of that int.

\Navarr\BinaryExploder\LinearBinaryExploder::explode(int $value) : iterable

Uses a linear algorithm that checks the logical AND of the number with increasing powers of 2.

This algorithm is typically fastest for numbers that are unlikely to be a power of 2.

Navarr\BinaryExploder\LogarithmicBinaryExploder::explode(int $value) : iterable

Uses a linear algorithm that checks the log(base 2) of the number and then it's remainders.

This algorithm is typically fastest for numbers that are likely to be a power of 2.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固