aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/ApplicationUtils.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/ApplicationUtils.php')
-rw-r--r--application/ApplicationUtils.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index 85dcbeeb..20fec376 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -220,4 +220,19 @@ class ApplicationUtils
220 220
221 return $errors; 221 return $errors;
222 } 222 }
223
224 /**
225 * Returns a salted hash representing the current Shaarli version.
226 *
227 * Useful for assets browser cache.
228 *
229 * @param string $currentVersion of Shaarli
230 * @param string $salt User personal salt, also used for the authentication
231 *
232 * @return string version hash
233 */
234 public static function getVersionHash($currentVersion, $salt)
235 {
236 return hash_hmac('sha256', $currentVersion, $salt);
237 }
223} 238}