1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Add Wallabag\CoreBundle\Helper\UrlHasher

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
Olivier Mehani 2019-05-10 22:07:55 +10:00 committed by Jeremy Benoist
parent d5744bf0df
commit 4a5516376b
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
5 changed files with 79 additions and 21 deletions

View file

@ -0,0 +1,22 @@
<?php
namespace Wallabag\CoreBundle\Helper;
/**
* Hash URLs for privacy and performance.
*/
class UrlHasher
{
/** @var string */
const ALGORITHM = 'sha1';
/**
* @param string $url
*
* @return string hashed $url
*/
public static function hashUrl(string $url)
{
return hash(static::ALGORITHM, $url);
}
}