X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/5b47a8995146637cdc2fa657631a6361dd749283..232d0fe60cb6990fd231a2645233e3ef8c00cbea:/Util/SluggerUtil.php diff --git a/Util/SluggerUtil.php b/Util/SluggerUtil.php index de8ce1b..8dc50df 100644 --- a/Util/SluggerUtil.php +++ b/Util/SluggerUtil.php @@ -118,10 +118,16 @@ class SluggerUtil { /** * Crypt and base64uri encode string * - * @param string $data The data string + * @param array|string $data The data string * @return string The hashed data */ - public function hash(string $data): string { + public function hash(array|string $data): string { + //With array + if (is_array($data)) { + //Json encode array + $data = json_encode($data); + } + //Return hashed data //XXX: we use hash_hmac with md5 hash //XXX: crypt was dropped because it provided identical signature for string starting with same pattern