From fa8301710fa44455ac763cf902971abb40817a72 Mon Sep 17 00:00:00 2001 From: Netkas Date: Thu, 15 Dec 2022 17:48:20 -0500 Subject: [PATCH] Added method \ncc\Objects > HttpRequest > requestHash() --- src/ncc/Objects/HttpRequest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ncc/Objects/HttpRequest.php b/src/ncc/Objects/HttpRequest.php index 9b28347..09e2972 100644 --- a/src/ncc/Objects/HttpRequest.php +++ b/src/ncc/Objects/HttpRequest.php @@ -77,6 +77,17 @@ ]; } + /** + * Returns the hash of the object. + * (This is used for caching) + * + * @return string + */ + public function requestHash(): string + { + return hash('sha1', json_encode($this->toArray())); + } + /** * Constructs a new HttpRequest object from an array representation. *