X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FApplicationUtils.php;h=5643f4a09706f2bb5b867153ee09c3c4974d77c3;hb=c8d96b4729a96ff2321862ca13a727658860e7a5;hp=123cc0b3e567ef531e4123dff6d31149d5f69ff5;hpb=b3e39bf57ecf0f92357b1f15051cf2e9d3f1b267;p=github%2Fshaarli%2FShaarli.git diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php index 123cc0b3..5643f4a0 100644 --- a/application/ApplicationUtils.php +++ b/application/ApplicationUtils.php @@ -221,4 +221,19 @@ class ApplicationUtils return $errors; } + + /** + * Returns a salted hash representing the current Shaarli version. + * + * Useful for assets browser cache. + * + * @param string $currentVersion of Shaarli + * @param string $salt User personal salt, also used for the authentication + * + * @return string version hash + */ + public static function getVersionHash($currentVersion, $salt) + { + return hash_hmac('sha256', $currentVersion, $salt); + } }