1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 00:35:59 +00:00
pixelfed/app/Util/Identicon/Preprocessor/HashPreprocessor.php
2018-08-28 03:07:36 +00:00

21 lines
398 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);
}
}