PHPackages                             delight-im/base64 - 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. delight-im/base64

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

delight-im/base64
=================

Simple and convenient Base64 encoding and decoding for PHP

v1.0.0(8y ago)15158.1k↑80.3%36MITPHPPHP &gt;=5.3.0

Since Jul 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/delight-im/PHP-Base64)[ Packagist](https://packagist.org/packages/delight-im/base64)[ Docs](https://github.com/delight-im/PHP-Base64)[ RSS](/packages/delight-im-base64/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (6)

PHP-Base64
==========

[](#php-base64)

Simple and convenient Base64 encoding and decoding for PHP

Requirements
------------

[](#requirements)

- PHP 5.3.0+

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

[](#installation)

1. Include the library via Composer [\[?\]](https://github.com/delight-im/Knowledge/blob/master/Composer%20(PHP).md):

    ```
    $ composer require delight-im/base64

    ```
2. Include the Composer autoloader:

    ```
    require __DIR__ . '/vendor/autoload.php';
    ```

Usage
-----

[](#usage)

### Standard

[](#standard)

- Encoding data

    ```
    \Delight\Base64\Base64::encode('Gallia est omnis divisa in partes tres');
    // string(52) "R2FsbGlhIGVzdCBvbW5pcyBkaXZpc2EgaW4gcGFydGVzIHRyZXM="
    ```
- Decoding data

    ```
    \Delight\Base64\Base64::decode('R2FsbGlhIGVzdCBvbW5pcyBkaXZpc2EgaW4gcGFydGVzIHRyZXM=');
    // string(38) "Gallia est omnis divisa in partes tres"
    ```

### URL-safe

[](#url-safe)

- Encoding data

    ```
    \Delight\Base64\Base64::encodeUrlSafe('πάντα χωρεῖ καὶ οὐδὲν μένει …');
    // string(80) "z4DOrM69z4TOsSDPh8-Jz4HOteG_liDOus6x4b22IM6_4b2QzrThvbLOvSDOvM6tzr3Otc65IOKApg~~"
    ```
- Decoding data

    ```
    \Delight\Base64\Base64::decodeUrlSafe('z4DOrM69z4TOsSDPh8-Jz4HOteG_liDOus6x4b22IM6_4b2QzrThvbLOvSDOvM6tzr3Otc65IOKApg~~');
    // string(58) "πάντα χωρεῖ καὶ οὐδὲν μένει …"
    ```

### URL-safe without padding

[](#url-safe-without-padding)

- Encoding data

    ```
    \Delight\Base64\Base64::encodeUrlSafeWithoutPadding('πάντα χωρεῖ καὶ οὐδὲν μένει …');
    // string(78) "z4DOrM69z4TOsSDPh8-Jz4HOteG_liDOus6x4b22IM6_4b2QzrThvbLOvSDOvM6tzr3Otc65IOKApg"
    ```
- Decoding data

    ```
    \Delight\Base64\Base64::decodeUrlSafeWithoutPadding('z4DOrM69z4TOsSDPh8-Jz4HOteG_liDOus6x4b22IM6_4b2QzrThvbLOvSDOvM6tzr3Otc65IOKApg');
    // string(58) "πάντα χωρεῖ καὶ οὐδὲν μένει …"
    ```

Specifications
--------------

[](#specifications)

- [RFC 4648](https://tools.ietf.org/html/rfc4648)
- [RFC 3548](https://tools.ietf.org/html/rfc3548)
- [RFC 2045](https://tools.ietf.org/html/rfc2045)
- [RFC 1421](https://tools.ietf.org/html/rfc1421)
- [RFC 7515](https://tools.ietf.org/html/rfc7515)

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

[](#contributing)

All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.

License
-------

[](#license)

This project is licensed under the terms of the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cabc03c705598aed200d843d4e5b1c6350729b060cc61ec8a1bb14e02e5c0a32?d=identicon)[delight-im](/maintainers/delight-im)

---

Top Contributors

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

---

Tags

urlencodingbase64encodedecodedecodingURL safebase-64

### Embed Badge

![Health badge](/badges/delight-im-base64/health.svg)

```
[![Health](https://phpackages.com/badges/delight-im-base64/health.svg)](https://phpackages.com/packages/delight-im-base64)
```

###  Alternatives

[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.4k48.6M278](/packages/hashids-hashids)[paragonie/constant_time_encoding

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

903329.7M148](/packages/paragonie-constant-time-encoding)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[spomky-labs/base64url

Base 64 URL Safe Encoding/Decoding PHP Library

15439.5M49](/packages/spomky-labs-base64url)[christian-riesen/base32

Base32 encoder/decoder according to RFC 4648

13331.8M61](/packages/christian-riesen-base32)[sqids/sqids

Generate short YouTube-looking IDs from numbers

5781.4M33](/packages/sqids-sqids)

PHPackages © 2026

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