{"id":17191642,"url":"https://github.com/fab2s/bom","last_synced_at":"2025-10-10T04:34:50.021Z","repository":{"id":56980945,"uuid":"201749552","full_name":"fab2s/Bom","owner":"fab2s","description":"A purely static zero dependencies Helper to handle unicode BOMs","archived":false,"fork":false,"pushed_at":"2021-06-16T09:46:18.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T20:45:23.174Z","etag":null,"topics":["big-endian","bom","byte-order-mark","little-endian","php","utf-16","utf-32","utf-8"],"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/fab2s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-11T10:20:59.000Z","updated_at":"2022-11-20T17:35:50.000Z","dependencies_parsed_at":"2022-08-21T11:20:32.996Z","dependency_job_id":null,"html_url":"https://github.com/fab2s/Bom","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fab2s/Bom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab2s%2FBom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab2s%2FBom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab2s%2FBom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab2s%2FBom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fab2s","download_url":"https://codeload.github.com/fab2s/Bom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab2s%2FBom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002670,"owners_count":26083442,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["big-endian","bom","byte-order-mark","little-endian","php","utf-16","utf-32","utf-8"],"created_at":"2024-10-15T01:26:56.049Z","updated_at":"2025-10-10T04:34:50.005Z","avatar_url":"https://github.com/fab2s.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bom\n\n[![Build Status](https://travis-ci.com/fab2s/Bom.svg?branch=master)](https://travis-ci.com/fab2s/Bom) [![Total Downloads](https://poser.pugx.org/fab2s/bom/downloads)](//packagist.org/packages/fab2s/bom) [![Monthly Downloads](https://poser.pugx.org/fab2s/bom/d/monthly)](//packagist.org/packages/fab2s/bom) [![Latest Stable Version](https://poser.pugx.org/fab2s/bom/v/stable)](https://packagist.org/packages/fab2s/bom) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fab2s/Bom/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fab2s/Bom/?branch=master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![License](https://poser.pugx.org/fab2s/bom/license)](https://packagist.org/packages/fab2s/bom)\n\nA purely static zero dependencies [byte Order Mark](https://en.wikipedia.org/wiki/Byte_order_mark) Helper to handle unicode BOMs\n\n## Installation\n\n`Bom` can be installed using composer:\n\n```\ncomposer require \"fab2s/bom\"\n```\n\n`Bom` is also included in [OpinHelper](https://github.com/fab2s/OpinHelpers) which packages several bellow \"Swiss Army Knife\" level Helpers covering some of the most annoying aspects of php programing, such as UTF8 string manipulation, high precision Mathematics or properly locking a file\n\nShould you need to work with php bellow 7.1, you can still use [OpinHelper](https://github.com/fab2s/OpinHelpers) `0.x`\n\n## Prerequisites\n\n`Bom` has no specific dependencies \n\n## In practice\n\n`Bom` supports `UTF-8|16|32` BOMs in both [_Little_](https://en.wikipedia.org/wiki/Endianness#Little) and [_Big_](https://en.wikipedia.org/wiki/Endianness#Big) [Endianness](https://en.wikipedia.org/wiki/Endianness)\n\n`Bom` is minimalistic, it only exposes five methods\n\n```php\n// get Bom\n$bomAtStartOfString = Bom::extract($string); // returns null when none are found\n\n// remove eventual BOM from beging of string\n$bomLessString = Bom::drop($string);\n\n// get encoding from a supported BOM\n$encoding = Bom::getBomEncoding($bom); // returns null if the BOM is not valid\n\n// get BOM for a supported encoding\n$bom = Bom::getEncodingBom($encoding); // returns null if the encoding is not supported (has no BOM)\n\n// get the list of BOMs as an array with corresponding encodings as indexes\n$boms = Bom::getBoms(); // returns an associatiove array of encodings and correesponding BOMs\n\nforeach ($boms as $encoding =\u003e $bom) {\n    // do something ...\n}\n```\n\n## Requirements\n\n`Bom` is tested against php 7.1, 7.2, 7.3, 7.4 and 8.0\n\n## Contributing\n\nContributions are welcome, do not hesitate to open issues and submit pull requests.\n\n## License\n\n`Bom` is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffab2s%2Fbom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffab2s%2Fbom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffab2s%2Fbom/lists"}