X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/packbundle/blobdiff_plain/5b47a8995146637cdc2fa657631a6361dd749283..09fee1b85a48764e77a2a3f132450b264ce12d0d:/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