Skip to content

Commit 15ce1ad

Browse files
committed
Use crc32 instead of md5 to increase performance
1 parent 216c66e commit 15ce1ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/JSONPath.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
use function array_merge;
1919
use function count;
20+
use function crc32;
2021
use function current;
2122
use function end;
2223
use function key;
23-
use function md5;
2424
use function next;
2525
use function reset;
2626

@@ -161,7 +161,7 @@ public function lastKey()
161161
*/
162162
public function parseTokens(string $expression): array
163163
{
164-
$cacheKey = md5($expression);
164+
$cacheKey = crc32($expression);
165165

166166
if (isset(static::$tokenCache[$cacheKey])) {
167167
return static::$tokenCache[$cacheKey];

0 commit comments

Comments
 (0)