PHP code example of fzed51 / spicy-mash

1. Go to this page and download the library: Download fzed51/spicy-mash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fzed51 / spicy-mash example snippets



$mash = new \Helper\SpicyMash();
$mashed = $mash->crypt('message', 'spicy');
echo $mash->decrypt($mashed, 'spicy'); // message


$mash = new \Helper\SpicyMash('spicy');
$mashed = $mash->crypt('message', 'more spicy');
echo $mash->decrypt($mashed, 'more spicy'); // message


$mash = new \Helper\SpicyMash('spicy');
$mashed = $mash->crypt('message');
echo $mash->decrypt($mashed); // message

$mash = new \Helper\SpicyMash();
$mashed = $mash->hash('message');
echo $mashed; // f8daf57a33..//..1770d5952c