kopia lustrzana https://github.com/pixelfed/pixelfed
Add custom identicon preprocessor
rodzic
7c1b70060c
commit
d9db890514
|
@ -0,0 +1,21 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue