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. *