alexandrutanasie / talex-helpers

Useful classes for the project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

To install talex/helpers run the command:

composer require talex/helpers
use  Talex\Helpers\Text;
$string = "example"
$text = new Text($string);

echo $text->truncate()->getText();

Usage Hash class

use  Talex\Helpers\Hash;

$plain_txt = "This is my plain text";
echo "Plain Text =" .$plain_txt. "\n";
$hash = new Hash($plain_txt);
$hash->setSecretKey("my secret key");
$hash->setSecretIV("my secret IV");

$encrypted_txt = $hash->encrypt();
echo "Encrypted Text = " .$encrypted_txt. "\n";
$decrypted_txt = $hash->decrypt($encrypted_txt);
echo "Decrypted Text =" .$decrypted_txt. "\n";
if ( $plain_txt === $decrypted_txt ) echo "SUCCESS";
else echo "FAILED";
echo "\n";

About

Useful classes for the project

License:MIT License


Languages

Language:PHP 100.0%