ae8/tokenizer

A simple PHP library for token-based encryption.

2.1 2024-08-02 03:31 UTC

This package is auto-updated.

Last update: 2024-11-14 20:36:20 UTC


README

Tokenizer is a simple PHP library for creating and validating token-based encryption.

Description

It is a simple and secure way to encrypt data generating small tokens that can be used as a parameter. It is useful for creating URLs with encrypted data, such as password reset links, email verification links, and more.

Installation

Tokenizer is available on Packagist, and installation via Composer is the recommended way to install Tokenizer. Just add this line to your composer.json file:

"ae8/tokenizer": "^1.5"

or run

composer require ae8/tokenizer

Note that the vendor folder and the vendor/autoload.php script are generated by Composer; they are not part of Tokenizer.

Usage

use AE8\Tokenizer\Tokenizer;

// Encrypt a value
$encrypted = Tokenizer::criptografar('Tokenizer');

// Decrypt a value
$decrypted = Tokenizer::descriptografar($encrypted);

echo $encrypted . PHP_EOL;
echo $decrypted . PHP_EOL;

Developer