From 5a18a4ce122b75d2bfafa20803391485e52858ad Mon Sep 17 00:00:00 2001 From: travail Date: Fri, 9 Jan 2015 18:47:19 +0900 Subject: [PATCH] Add methods bin() and hex() --- lib/PerceptualHash/Algorithm.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/PerceptualHash/Algorithm.php b/lib/PerceptualHash/Algorithm.php index 1db417e..70aa818 100644 --- a/lib/PerceptualHash/Algorithm.php +++ b/lib/PerceptualHash/Algorithm.php @@ -5,10 +5,18 @@ namespace Image\PerceptualHash; interface Algorithm { /** - * Calculate the hash + * Calculate the binary hash * * @param resource $resource - * @return string + * @return string Binary string */ - public function calculate($resource); + public function bin($resource); + + /** + * Calculate the hex hash + * + * @param resource $resource + * @return string Hex string + */ + public function hex($binary); }