{"id":18766332,"url":"https://github.com/navarr/binary-explode","last_synced_at":"2025-12-08T23:30:17.945Z","repository":{"id":15480105,"uuid":"78233776","full_name":"navarr/binary-explode","owner":"navarr","description":"Explode a number into it's binary components","archived":false,"fork":false,"pushed_at":"2022-04-03T14:22:31.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-29T06:22:24.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-06T19:44:41.000Z","updated_at":"2022-01-10T16:43:02.000Z","dependencies_parsed_at":"2022-08-07T08:01:08.449Z","dependency_job_id":null,"html_url":"https://github.com/navarr/binary-explode","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fbinary-explode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fbinary-explode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fbinary-explode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fbinary-explode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navarr","download_url":"https://codeload.github.com/navarr/binary-explode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239669134,"owners_count":19677684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T18:40:19.109Z","updated_at":"2025-12-08T23:30:17.914Z","avatar_url":"https://github.com/navarr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binary Exploders\n[![Latest Stable Version](http://poser.pugx.org/navarr/binary-explode/v)](https://packagist.org/packages/navarr/binary-explode)\n[![Total Downloads](http://poser.pugx.org/navarr/binary-explode/downloads)](https://packagist.org/packages/navarr/binary-explode)\n[![Latest Unstable Version](http://poser.pugx.org/navarr/binary-explode/v/unstable)](https://packagist.org/packages/navarr/binary-explode)\n[![License](http://poser.pugx.org/navarr/binary-explode/license)](https://packagist.org/packages/navarr/binary-explode)  \n![Tests](https://github.com/navarr/binary-explode/actions/workflows/commit.yml/badge.svg)\n![Code Coverage](https://codecov.io/gh/navarr/binary-explode/branch/master/graph/badge.svg?token=BHTKOZZDR3)\n[![Mutation Score](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fnavarr%2Fbinary-explode%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/navarr/binary-explode/main)\n\nThis package provides two functions usable to convert a number into an array of it's binary components.\n\nExamples:\n\n1. \\[1]\n2. \\[2]\n3. \\[2, 1]\n4. \\[4]\n5. \\[4, 1]\n6. \\[4, 2]\n7. \\[4, 2, 1]\n\netc\n\n## Usage\n\n### Installation\n\n```\ncomposer require navarr/binary-explode`\n```\n\n### Shared Interface\n\nThis package provides a shared interface, `\\Navarr\\BinaryExploder\\BinaryExploderInterface`.  This interface takes an `int` and returns an `iterable\u003cint\u003e` containing or generating the binary components of that `int`.\n\n### \\Navarr\\BinaryExploder\\LinearBinaryExploder::explode(int $value) : iterable\u003cint\u003e\n\nUses a linear algorithm that checks the logical AND of the number with increasing powers of 2.\n\nThis algorithm is typically fastest for numbers that are unlikely to be a power of 2.\n\n### Navarr\\BinaryExploder\\LogarithmicBinaryExploder::explode(int $value) : iterable\u003cint\u003e\n\nUses a linear algorithm that checks the log(base 2) of the number and then it's remainders.\n\nThis algorithm is typically fastest for numbers that are likely to be a power of 2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavarr%2Fbinary-explode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavarr%2Fbinary-explode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavarr%2Fbinary-explode/lists"}