kopia lustrzana https://github.com/pixelfed/pixelfed
22 wiersze
398 B
PHP
22 wiersze
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);
|
|
}
|
|
}
|