From 76a027c9bbfc646c9690f00d63be49cc4287b9c3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 10 Nov 2013 22:45:58 +0100 Subject: Amélioration des performances de small_hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/lib_rss.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 7f22c8244..2f694fc12 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -9,14 +9,10 @@ function login_is_conf ($conf) { return $conf->mailLogin () != false; } -// tiré de Shaarli de Seb Sauvage +// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url function small_hash ($txt) { $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '='); - $t = str_replace ('+', '-', $t); // Get rid of characters which need encoding in URLs. - $t = str_replace ('/', '_', $t); - $t = str_replace ('=', '@', $t); - - return $t; + return strtr ($t, '+/', '-_'); } function timestamptodate ($t, $hour = true) { -- cgit v1.2.3