summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-10 22:45:58 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-10 22:45:58 +0100
commit76a027c9bbfc646c9690f00d63be49cc4287b9c3 (patch)
treebb3df87fe9d02bb9bde9b221d57a1c10bb13eada /lib/lib_rss.php
parent3bd4e808789b53ed6b338f4dbe42494b00ae1251 (diff)
Amélioration des performances de small_hash
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php8
1 files changed, 2 insertions, 6 deletions
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) {