PHPackages                             rayne/ecoji - 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. rayne/ecoji

ActiveLibrary

rayne/ecoji
===========

Encodes (and decodes) data as emojis. Implementation of the Ecoji Standard.

1.2.0(5y ago)34801MITPHPPHP ^7.2|^8.0

Since Mar 13Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Rayne/ecoji-php)[ Packagist](https://packagist.org/packages/rayne/ecoji)[ RSS](/packages/rayne-ecoji/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

Ecoji for PHP 🏣🔉🦐🔼🍉🔹🦒📲🐒🍍🀄☕
==========================

[](#ecoji-for-php-)

Ecoji encodes data as 1024 emojis. It's like `base1024` with an emoji character set. Visit [ecoji.io](https://ecoji.io) to try Ecoji in your browser.

> [`rayne/ecoji`](https://packagist.org/packages/rayne/ecoji) is a PHP port of [Ecoji](https://github.com/keith-turner/ecoji) with 100% test coverage.

[![Latest Stable Version](https://camo.githubusercontent.com/13fa53c02276629499cc5dad9e021d59f460ee2aa1f22ba3ed3466200075f167/68747470733a2f2f706f7365722e707567782e6f72672f7261796e652f65636f6a692f762f737461626c65)](https://packagist.org/packages/rayne/ecoji)[![Code Coverage](https://camo.githubusercontent.com/499863b7c29e343ffceb15927b1a415f7f5020ccd29daea52272222d9c266003/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261796e652f65636f6a692d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rayne/ecoji-php/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/17390d90fda7898bdd5aa34d5c548a501bea09d07de2626fa9bf721944dc0bc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261796e652f65636f6a692d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rayne/ecoji-php/?branch=master)[![License](https://camo.githubusercontent.com/68436259f3f87e3e0ebdb1139d1871471aba739795466b44a1a1e739d89c54bc/68747470733a2f2f706f7365722e707567782e6f72672f7261796e652f65636f6a692f6c6963656e7365)](https://packagist.org/packages/rayne/ecoji)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Encoding](#encoding)
- [Decoding](#decoding)
- [Streams](#streams)
- [CLI](#cli)
- [Docker](#docker)

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

[](#installation)

```
composer require rayne/ecoji
```

Encoding
--------

[](#encoding)

```
use Rayne\Ecoji\Ecoji;

$ecoji = new Ecoji;
$ecoji->encode("Base64 is so 1999, isn\'t there something better?\n");
```

```
🏗📩🎦🐇🎛📘🔯🚜💞😽🆖🐊🎱🥁🚄🌱💞😭💮🇵💢🕥🐭🔸🍉🚲🦑🐶💢🕥🔮🔺🍉📸🐮🌼👦🚟🥴📑

```

Decoding
--------

[](#decoding)

```
use Rayne\Ecoji\Ecoji;

$ecoji = new Ecoji;
$ecoji->decode('🏗📩🎦🐇🎛📘🔯🚜💞😽🆖🐊🎱🥁🚄🌱💞😭💮🇵💢🕥🐭🔸🍉🚲🦑🐶💢🕥🔮🔺🍉📸🐮🌼👦🚟🥴📑');
```

```
Base64 is so 1999, isn't there something better?

```

Streams
-------

[](#streams)

```
use Rayne\Ecoji\Ecoji;

$ecoji = new EcojiStream;
$ecoji->encode($sourceStream, $destinationStream);
$ecoji->decode($sourceStream, $destinationStream);
```

`EcojiStream` doesn't wrap the encoded stream without configuring the wrap length first. A value of `0` disables wrapping.

```
use Rayne\Ecoji\Ecoji;

$ecoji = new EcojiStream;
$ecoji->setWrap(80);
```

CLI
---

[](#cli)

The CLI encodes and decodes files and streams.

```
./bin/ecoji --help
```

```
Usage: ecoji [OPTIONS]... [FILE]

Encode or decode data as Unicode emojis. 😁

Options:
    -d, --decode          Decode data.
    -w, --wrap COLS       Wrap encoded lines after COLS characters (default 76).
                          Use 0 to disable line wrapping.
    -h, --help            Print this message.
    -v, --version         Print version information.

```

Installing the Composer package `rayne/ecoji` will create a symlink, e.g. `vendor/bin/ecoji`.

Docker
------

[](#docker)

Launch a temporary [Ecoji Docker container](https://hub.docker.com/r/rayne/ecoji) to utilize the CLI:

```
docker run -it --rm rayne/ecoji --help
```

Pipe data through a container:

```
echo -n "Ecoji for Docker" | docker run -i --rm rayne/ecoji
🏣🔉🦐🔼🍉🔹🦒📲🏟🙁🎧🤒💙☕☕☕
```

Encode or decode a file by mounting it as volume or piping its content through a container:

```
docker run -it --rm -v /my/message:/file rayne/ecoji /file
```

```
cat /my/message | docker run -i --rm rayne/ecoji
```

### Docker Images

[](#docker-images)

The [`docker/README.md`](docker/README.md) explains how to build the application and all optional development images for all supported PHP versions. Additional convenience scripts run the unit tests with all supported PHP versions.

Tests
-----

[](#tests)

The library registers the test runner as composer script.

```
composer test
```

All units tests can also be run in the development containers specified in the `docker` directory.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97% 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 ~358 days

Total

4

Last Release

1909d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.2.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c8280f00784624f044fa15aa869fd0a3958b0ade356a01297eff1f6240332e2?d=identicon)[Rayne](/maintainers/Rayne)

---

Top Contributors

[![Rayne](https://avatars.githubusercontent.com/u/1098733?v=4)](https://github.com/Rayne "Rayne (32 commits)")[![keith-turner](https://avatars.githubusercontent.com/u/1268739?v=4)](https://github.com/keith-turner "keith-turner (1 commits)")

---

Tags

composer-libraryecojiecoji-phpphp-libraryencodingdecodingemojiecojibase1024

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/rayne-ecoji/health.svg)

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

###  Alternatives

[zbateson/mb-wrapper

Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation

4948.6M5](/packages/zbateson-mb-wrapper)[delight-im/base64

Simple and convenient Base64 encoding and decoding for PHP

15158.1k6](/packages/delight-im-base64)[anisimov/emoji

Allows to detect emoji, remove emoji, encode emoji and decode emoji in string.

103.7k](/packages/anisimov-emoji)[falseclock/advanced-cms

A PHP Library that allows you to decode and manipulate CAdES or in other words CMS Advanced Electronic Signatures described in ETSI standart TS 101 733.

223.2k](/packages/falseclock-advanced-cms)[adapik/cms

A PHP Library that allows you to decode ASN.1 CMS using Basic Encoding Rules (BER).

147.2k1](/packages/adapik-cms)

PHPackages © 2026

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