mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-23 11:38:34 -04:00
Amélioration des performances de small_hash
This commit is contained in:
1 parent
3bd4e80878
commit
76a027c9bb
2 files changed
+4
-11
No files matched your search
+2
-6
@@ -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) {
|
||||
|
||||
+2
-5
@@ -66,13 +66,10 @@ function writeArray ($f, $array) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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, '+/', '-_');
|
||||
}
|
||||
|
||||
// gestion internationalisation
|
||||
|
||||
Reference in new issue
Block a user