1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/Util/Identicon/Preprocessor/HashPreprocessor.php
2018-05-19 21:02:13 -06:00

21 lines
No EOL
395 B
PHP

<?php
namespace App\Util\Identicon\Preprocessor;
class HashPreprocessor implements \Bitverse\Identicon\Preprocessor\PreprocessorInterface
{
protected $algo = 'sha256';
public function __construct($algo = 'sha256')
{
$this->algo = $algo;
}
/**
* {@inheritDoc}
*/
public function process($string)
{
return hash($this->algo, $string);
}
}