X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FApplicationUtils.php;h=20fec376faebddda7b040eb2b35a73e457396fd8;hb=bfe4f536bbfe03f38e0c801bfbd26587a2b64a7f;hp=85dcbeebdb164858680ff68b9fbc1048340d05f1;hpb=a59bbf50d7530d7e82a91896a210b9da49cb1568;p=github%2Fshaarli%2FShaarli.git 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 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); + } }