PHPackages                             root23/php-json-canonicalization - 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. root23/php-json-canonicalization

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

root23/php-json-canonicalization
================================

Serialize data into canonical way, based on RFC-8785.

1.0.1(2y ago)1202.7k↓41.2%PHPPHP &gt;=8.0

Since Sep 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/root23/php-json-canonicalization)[ Packagist](https://packagist.org/packages/root23/php-json-canonicalization)[ RSS](/packages/root23-php-json-canonicalization/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

php-json-canonicalization
=========================

[](#php-json-canonicalization)

Serialize data into canonical way, based on RFC-8785.

RFC-8785 -

Inspired by  &amp;

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

[](#installation)

```
composer require root23/php-json-canonicalizator

```

Usage
-----

[](#usage)

```
$canonicalizator = JsonCanonicalizatorFactory::getInstance();
$canonicalizedJsonString = $canonicalizator->canonicalize($input, false);
$canonicalizedJsonString = $canonicalizator->canonicalize($input, true); // hex

```

Example input:
--------------

[](#example-input)

```
{
  "numbers": [333333333.33333329, 1E30, 4.50, 2e-3, 0.000000000000000000000000001],
  "string": "\u20ac$\u000F\u000aA'\u0042\u0022\u005c\\\"\/",
  "literals": [null, true, false]
}

```

Output:
-------

[](#output)

```
{"literals":[null,true,false],"numbers":[333333333.3333333,1e+30,4.5,0.002,1e-27],"string":"€$\u000f\nA'B\"\\\\\"/"}

```

Hexademical Output:
-------------------

[](#hexademical-output)

```
7b 22 6c 69 74 65 72 61 6c 73 22 3a 5b 6e 75 6c 6c 2c 74 72 75 65 2c 66 61 6c 73 65 5d 2c 22 6e
75 6d 62 65 72 73 22 3a 5b 33 33 33 33 33 33 33 33 33 2e 33 33 33 33 33 33 33 2c 31 65 2b 33 30
2c 34 2e 35 2c 30 2e 30 30 32 2c 31 65 2d 32 37 5d 2c 22 73 74 72 69 6e 67 22 3a 22 e2 82 ac 24
5c 75 30 30 30 66 5c 6e 41 27 42 5c 22 5c 5c 5c 5c 5c 22 2f 22 7d

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~6 days

Total

2

Last Release

965d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53cf142bad3e56c48f0e1841424b9e283dddfee26702e0b99d495a9d3a053140?d=identicon)[root23](/maintainers/root23)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/root23-php-json-canonicalization/health.svg)

```
[![Health](https://phpackages.com/badges/root23-php-json-canonicalization/health.svg)](https://phpackages.com/packages/root23-php-json-canonicalization)
```

PHPackages © 2026

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