PHPackages                             innmind/encoding - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. innmind/encoding

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

innmind/encoding
================

3.0.0(4mo ago)013.7k↓76%[1 PRs](https://github.com/Innmind/encoding/pulls)1MITPHPPHP ~8.4CI passing

Since Oct 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Innmind/encoding)[ Packagist](https://packagist.org/packages/innmind/encoding)[ Docs](http://github.com/innmind/encoding)[ RSS](/packages/innmind-encoding/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (4)Dependencies (6)Versions (9)Used By (1)

Encoding
========

[](#encoding)

[![Build Status](https://github.com/innmind/encoding/workflows/CI/badge.svg?branch=master)](https://github.com/innmind/encoding/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/0a6cf609a95046ca9658b3dbd34cbd07b34baf58fec819ca7c20f6f57222dabc/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f656e636f64696e672f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/encoding)[![Type Coverage](https://camo.githubusercontent.com/95994a3e79086a166960eedcb47723592daaace9110f6fac33181f4f7168e03d/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f656e636f64696e672f636f7665726167652e737667)](https://shepherd.dev/github/innmind/encoding)

This packages allows to encode and compress files and directories without the need for them to be written to the filesystem and never loaded entirely in memory.

Note

Each file contained in a `tar` file can't exceed an 8Go size.

Installation
------------

[](#installation)

```
composer require innmind/encoding
```

Usage
-----

[](#usage)

```
use Innmind\Filesystem\{
    Adapter,
    Name,
};
use Innmind\Time\Clock;
use Innmind\Url\Path;
use Innmind\Encoding\{
    Gzip,
    Tar,
};

$adapter = Adapter::mount(Path::of('some/directory/'))->unwrap();
$tar = $adapter
    ->get(Name::of('data'))
    ->map(Tar::encode(Clock::live()))
    ->map(Gzip::compress())
    ->match(
        static fn($file) => $file,
        static fn() => null,
    );
```

Here `$tar` represents a `.tar.gz` file content containing all the files and directories from `some/directory/data/`, unless the `data` doesn't exist then it is `null`.

Documentation
-------------

[](#documentation)

Full documentation can be found at .

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance83

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~275 days

Total

4

Last Release

128d ago

Major Versions

1.1.0 → 2.0.02025-04-16

2.0.0 → 3.0.02026-02-01

PHP version history (2 changes)1.0.0PHP ~8.2

3.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (65 commits)")

---

Tags

encodinggzipdeflate

### Embed Badge

![Health badge](/badges/innmind-encoding/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-encoding/health.svg)](https://phpackages.com/packages/innmind-encoding)
```

###  Alternatives

[paragonie/constant_time_encoding

Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)

904351.6M178](/packages/paragonie-constant-time-encoding)[paquettg/string-encode

Facilitating the process of altering string encoding in PHP.

699.0M43](/packages/paquettg-string-encode)[onnov/detect-encoding

Text encoding definition class instead of mb\_detect\_encoding. Defines: utf-8, windows-1251, koi8-r, iso-8859-5, ibm866, .....

224.0M15](/packages/onnov-detect-encoding)[jawira/plantuml-encoding

PlantUML encoding functions

20605.9k11](/packages/jawira-plantuml-encoding)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)[ddeboer/transcoder

Better encoding conversion for PHP

16714.7k10](/packages/ddeboer-transcoder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
