PHP code example of filipsedivy / recryptor

1. Go to this page and download the library: Download filipsedivy/recryptor 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/ */

    

filipsedivy / recryptor example snippets



ryptor = new ReCryptor();
$recryptor->setInput('MyPassword');
$recryptor->setHash('daa1f31819ed4928fd00e986e6bda6dab6b177dcbool');
$result = $recryptor->recrypt('SHA1');

if($result->needRehash())
{
    // Need save new hash
    $hash = $result->getHash();
}
else
{
    // Not need change hash
}


yptor = new ReCryptor();
print_r($recryptor->getAlgorithms());


eCryptor\Algorithm\SHA512;
$sha512 = new SHA512();
$sha512->setInput('Hello world');
echo $sha512->hash();


eCryptor\Algorithm\SHA512;
$sha512 = new SHA512();
$sha512->setInput('Hello world');
$sha512->setHash('098f6bcd4621d373cade4e832627b4f6');
var_dump($sha512->isAlgorithm());