PHPackages                             mobilefuse/php-tcf2-decoder - 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. mobilefuse/php-tcf2-decoder

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

mobilefuse/php-tcf2-decoder
===========================

A fast, light-weight TCF2 decoder

1.0.0(5y ago)118MITPHPPHP &gt;=7.0.0

Since Dec 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MobileFuse/php-tcf2-decoder)[ Packagist](https://packagist.org/packages/mobilefuse/php-tcf2-decoder)[ RSS](/packages/mobilefuse-php-tcf2-decoder/feed)WikiDiscussions master Synced 3w ago

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

PHP Library for Decoding TCF2 Consent Strings
=============================================

[](#php-library-for-decoding-tcf2-consent-strings)

We created this utility class to be able to have a fast and lightweight library for decoding TCF2 consent strings.

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

[](#installation)

Require the package via composer

```
composer require mobilefuse/php-tcf2-decoder

```

Usage
-----

[](#usage)

```
use MobileFuse\Tcf2Decoder\ConsentString;

$consent = ConsentString::decode("COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw");

var_dump($consent);

```

Output:

```
array(3) {
  ["version"]=>
  int(2)
  ["core"]=>
  array(19) {
    ["version"]=>
    int(2)
    ["created"]=>
    int(1582243059300)
    ["lastUpdated"]=>
    int(1582243059300)
    ["cmpId"]=>
    int(27)
    ["cmpVersion"]=>
    int(0)
    ["consentScreen"]=>
    int(0)
    ["consentLanguage"]=>
    string(2) "EN"
    ["vendorListVersion"]=>
    int(15)
    ["policyVersion"]=>
    int(2)
    ["isServiceSpecific"]=>
    bool(false)
    ["useNonStandardStacks"]=>
    bool(false)
    ["specialFeatureOptins"]=>
    array(0) {
    }
    ["purposeConsents"]=>
    array(3) {
      [1]=>
      int(1)
      [2]=>
      int(2)
      [3]=>
      int(3)
    }
    ["purposeLegitimateInterests"]=>
    array(0) {
    }
    ["purposeOneTreatment"]=>
    bool(false)
    ["publisherCountryCode"]=>
    string(2) "AA"
    ["vendorConsents"]=>
    array(3) {
      [2]=>
      int(2)
      [6]=>
      int(6)
      [8]=>
      int(8)
    }
    ["vendorLegitimateInterests"]=>
    array(3) {
      [2]=>
      int(2)
      [6]=>
      int(6)
      [8]=>
      int(8)
    }
    ["publisherRestrictions"]=>
    array(0) {
    }
  }
  ["vendorsDisclosed"]=>
  array(1) {
    ["vendorsDisclosed"]=>
    array(79) {
      [2]=>
      int(2)
      [6]=>
      int(6)
      [8]=>
      int(8)
      // ...
    }
  }
}

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

2029d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mobilefuse-php-tcf2-decoder/health.svg)

```
[![Health](https://phpackages.com/badges/mobilefuse-php-tcf2-decoder/health.svg)](https://phpackages.com/packages/mobilefuse-php-tcf2-decoder)
```

###  Alternatives

[urb/xenforobridge

Xenforo Bridge - Easy to use extendable bridge to use outside of your XenForo application all contained within a simple to use composer package

255.7k](/packages/urb-xenforobridge)

PHPackages © 2026

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