2017 © Pedro Peláez
 

library binary-explode

Explode a number into it's binary components

image

navarr/binary-explode

Explode a number into it's binary components

  • Friday, January 6, 2017
  • by navarr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,194 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 3 Versions
  • 13 % Grown

The README.md

Binary Exploders

Latest Stable Version Total Downloads Latest Unstable Version License
Tests Code Coverage Mutation Score, (*1)

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

Examples:, (*3)

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

etc, (*4)

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., (*5)

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

Uses a linear algorithm that checks the logical AND of the number with increasing powers of 2., (*6)

This algorithm is typically fastest for numbers that are unlikely to be a power of 2., (*7)

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

This algorithm is typically fastest for numbers that are likely to be a power of 2., (*9)

The Versions

06/01 2017

dev-master

9999999-dev

Explode a number into it's binary components

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Matthew Trimmer

06/01 2017

v1.1.0

1.1.0.0

Explode a number into it's binary components

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Matthew Trimmer

06/01 2017

v1.0.0

1.0.0.0

Explode a number into it's binary components

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Matthew Trimmer