定制 titasgailius/php-bits 二次开发

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

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

titasgailius/php-bits

Composer 安装命令:

composer require titasgailius/php-bits

包简介

Make bitwise operations easier in PHP

README 文档

README

Advanced bitwise operations using PHP made simplier

Installation

With composer

$ composer install titasgailius/php-bits

{
    "require": {
        "titasgailius/php-bits": "~1.00"
    }
}

Examples

<?php

require 'vendor/autoload.php';

use PHPBits\Bits;

/**
 * Convert string to a binary string
 *
 * Bits::strbin(string $string) : string
 */
Bits::strbin('Hello'); // "0100100001100101011011000110110001101111"

/**
 * Converts string to a decimal number representation
 *
 * Bits::strdec(string $string) : int
 */
Bits::strdec('Hello'); // 310939249775

/**
 * Converts an integer to a binary string
 *
 * Bits::decbin(int $integer, int $length = 8) : string
 */
Bits::decbin(10); // 00001010
Bits::decbin(10, 16); // 0000000000001010

/**
 * Get count of bits in a string
 *
 * Bits::strlen(string $string) : int
 *
 */
Bits::strlen('Hello');  // 40

/**
 * Rotate integer's bits to left by 1 position and return new integer

 * Bits::decRotateLeft(int $integer, int $positions = 1) : int
 */
Bits::decRotateLeft(10);
// 20, because 10 is "00010100" in binary so rotated it's "00010100" which is 20.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-05-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固