joetannenbaum / obfuscate
Obfuscate strings in HTML using JavaScript (e.g. mailto links)
dev-master
2022-05-16 00:36 UTC
Requires
- php: >=7.1.3
This package is auto-updated.
Last update: 2024-10-16 05:45:28 UTC
README
A quick-and-dirty library to obfuscate sensitive strings by dynamically creating special characters to print them out. Not foolproof by any means.
Installation
composer require joetannenbaum/obfuscate
Usage
use Obfuscate\Obfuscate; require __DIR__ . '/vendor/autoload.php'; echo Obfuscate::str('this is a secret!'); echo Obfuscate::mailto('obfuscate@joe.codes');
...results in (different every time, still renders properly in HTML):
this is a secret! <a href="mailto:obfuscate@joe.codes">obfuscate@joe.codes</a>
Laravel
If you're using Laravel, this package automatically adds a Blade helper:
@obfuscate('this is a secret!') @mailto('obfuscate@joe.codes')