From 1ae30d62dbd04c4849964a3758df6c2a3654b35a Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Thu, 1 Dec 2011 08:49:42 +0100 Subject: [PATCH] Returns the SHA1 hash of a Lua script from instances of ServerEval. --- lib/Predis/Commands/ServerEval.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Predis/Commands/ServerEval.php b/lib/Predis/Commands/ServerEval.php index f6b60deb..fe647871 100644 --- a/lib/Predis/Commands/ServerEval.php +++ b/lib/Predis/Commands/ServerEval.php @@ -46,4 +46,14 @@ class ServerEval extends Command { return false; } + + /** + * Calculates the SHA1 hash of the body of the script. + * + * @return string SHA1 hash. + */ + public function getScriptHash() + { + returns sha1($this->getArgument(0)); + } }