PHPackages                             tiny-blocks/encoder - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. tiny-blocks/encoder

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

tiny-blocks/encoder
===================

Encoder and decoder for arbitrary data.

3.2.0(4mo ago)378.4k—7.7%1MITPHPPHP ^8.5CI passing

Since Jun 7Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/tiny-blocks/encoder)[ Packagist](https://packagist.org/packages/tiny-blocks/encoder)[ Docs](https://github.com/tiny-blocks/encoder)[ RSS](/packages/tiny-blocks-encoder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (11)Used By (1)

Encoder
=======

[](#encoder)

[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

- [Overview](#overview)
- [Installation](#installation)
- [How to use](#how-to-use)
- [License](#license)
- [Contributing](#contributing)

Overview
--------

[](#overview)

Encoder and decoder for arbitrary data.

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

[](#installation)

```
composer require tiny-blocks/encoder
```

How to use
----------

[](#how-to-use)

The library provides concrete implementations of the `Encoder` interface, enabling encoding and decoding of data into specific formats like Base62.

### Using Base62

[](#using-base62)

To encode a value into Base62 format:

```
$encoder = Base62::from(value: 'Hello world!');
$encoded = $encoder->encode();

# Output: T8dgcjRGuYUueWht
```

To decode a Base62-encoded value back to its original form:

```
$encoder = Base62::from(value: 'T8dgcjRGuYUueWht');
$decoded = $encoder->decode();

# Output: Hello world!
```

If you attempt to decode an invalid Base62 value, an `InvalidDecoding` exception will be thrown:

```
try {
    $encoder = Base62::from(value: 'invalid_value');
    $decoded = $encoder->decode();
} catch (InvalidDecoding $exception) {
    echo $exception->getMessage();
    # Output: The value  could not be decoded.
}
```

License
-------

[](#license)

Encoder is licensed under [MIT](LICENSE).

Contributing
------------

[](#contributing)

Please follow the [contributing guidelines](https://github.com/tiny-blocks/tiny-blocks/blob/main/CONTRIBUTING.md) to contribute to the project.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance81

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% 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 ~105 days

Recently: every ~116 days

Total

10

Last Release

126d ago

Major Versions

1.2.2 → 2.0.02024-10-04

2.0.0 → 3.0.02024-12-03

PHP version history (4 changes)1.0.0PHP ^8.2

1.2.2PHP ^8.1||^8.2

3.0.0PHP ^8.3

3.2.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00a83241d2af272255f1755bf6aff48e77821c59ef623520176d9e828977241?d=identicon)[gustavofreze](/maintainers/gustavofreze)

---

Top Contributors

[![gustavofreze](https://avatars.githubusercontent.com/u/22873481?v=4)](https://github.com/gustavofreze "gustavofreze (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

base62decoderencoderencoder-decoderhacktoberfestopen-sourcephptiny-blockspsrbase62encoderdecodertiny-blocks

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tiny-blocks-encoder/health.svg)

```
[![Health](https://phpackages.com/badges/tiny-blocks-encoder/health.svg)](https://phpackages.com/packages/tiny-blocks-encoder)
```

###  Alternatives

[psr/container

Common Container Interface (PHP FIG PSR-11)

10.0k1.0B3.7k](/packages/psr-container)[psr/clock

Common interface for reading the clock.

642332.9M343](/packages/psr-clock)[lctrs/psalm-psr-container-plugin

Let Psalm understand better psr11 containers

17648.1k13](/packages/lctrs-psalm-psr-container-plugin)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)[base62/base62

base62 encoder and decoder also for big numbers with Laravel integration

169.5k](/packages/base62-base62)

PHPackages © 2026

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