PHPackages                             juanchosl/tokenizer - 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. juanchosl/tokenizer

ActiveLibrary

juanchosl/tokenizer
===================

A small collection of encoder/decoder Token for authentication

1.0.4(3mo ago)120MITPHPPHP ^8.1

Since Mar 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/JuanchoSL/Tokenizer)[ Packagist](https://packagist.org/packages/juanchosl/tokenizer)[ Docs](https://github.com/JuanchoSL/Tokenizer)[ RSS](/packages/juanchosl-tokenizer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (8)Used By (0)

Tokenizer
=========

[](#tokenizer)

Description
-----------

[](#description)

A small collection of encoder/decoder Token for authentication

This is a test project in order to check how works the composer installation directly from GitHub

Install
-------

[](#install)

```
composer require juanchosl/tokenizer
```

How use it
----------

[](#how-use-it)

### Entities

[](#entities)

The system use a **CredentialInterface** as DTO, a simple object with username and password

All credentials needs to be pushed into a **CredentialsInterface** collection, a sequence of available usersto compare. We provide a simple Collection in order to push a few users, but is importante that you create your own implementation in order to search usrs into database, as usual

In a login request, you needs to ensure the username+password validation before create a token

### Use a concret Tokenizer

[](#use-a-concret-tokenizer)

#### For create a token

[](#for-create-a-token)

```
$options = [
    JwtToken::OPTION_ISSUER => $_ENV['CYPHER_KEY'],
    JwtToken::OPTION_AUDIENCE => 'Restricted area'
];
$tokenizer = new JuanchoSL\Tokenizer\Repositories\JwtToken($options);
$token = $tokenizer->encode(new Credential($username, $password));
```

#### For decode a token

[](#for-decode-a-token)

```
$user_data = $tokenizer->decode($token);
```

#### For a check a token with a previously retrieved user

[](#for-a-check-a-token-with-a-previously-retrieved-user)

```
$tokenizer->check($db_data, $token):
```

### Use the provided service

[](#use-the-provided-service)

#### For create a token

[](#for-create-a-token-1)

```
$options = [
    JwtToken::OPTION_ISSUER => $_ENV['CYPHER_KEY'],
    JwtToken::OPTION_AUDIENCE => 'Restricted area'
];
$tokenizer = new JuanchoSL\Tokenizer\Repositories\JwtToken($options);
$service = new Authentication($tokenizer, new Credentials);
$service->authenticateByCredential($credential);
return $service->generateToken($credential);
```

#### For decode a token

[](#for-decode-a-token-1)

```
$options = [
    JwtToken::OPTION_ISSUER => $_ENV['CYPHER_KEY'],
    JwtToken::OPTION_AUDIENCE => 'Restricted area'
];
$tokenizer = new JuanchoSL\Tokenizer\Repositories\JwtToken($options);
$service = new Authentication($tokenizer, new Credentials);
return $service->->authenticateByToken($token);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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 ~263 days

Total

5

Last Release

106d ago

PHP version history (2 changes)1.0.0PHP ^7.1 || ^8.0

1.0.4PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

tokenjwt-tokenbearer tokenbasic tokendigest token

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/juanchosl-tokenizer/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[kreait/firebase-tokens

A library to work with Firebase tokens

24040.8M14](/packages/kreait-firebase-tokens)[adhocore/jwt

Ultra lightweight JSON web token (JWT) library for PHP5.5+.

3031.6M15](/packages/adhocore-jwt)[psecio/jwt

A JWT (JSON Web Token) Encoding &amp; Decoding library

109352.2k2](/packages/psecio-jwt)[bizley/jwt

JWT integration for Yii 2

67425.3k2](/packages/bizley-jwt)[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

91214.0k3](/packages/rajentrivedi-tokenizer-x)

PHPackages © 2026

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